Scientific Method Function In Java