import java.util.Scanner; public class MaximumFinder { public void findMaximun() { Scanner input = new Scanner (System.in); System.out.print( "Enter three floating poing values sepertated by spaced: "); double number1 = input.nextDouble(); double number2 = input.nextDouble(); double number3 = input.nextDouble(); //double result = maximun (number1, number2, number3); // must match with double values and order double result = maximun (number1, Math.sqrt(81), number1/number2); // must match with double values and order System.out.println("Maximum is: " + result); } public double maximun (double x, double y, double z) //must match with double values and order { return Math.max( x, Math.max( y, z)); } }
Main Method
public class MaximumMain { public static void main (String [] args) { MaximumFinder maximumFinder = new MaximumFinder(); maximumFinder.findMaximun(); } }
I always had a passion for the field of STEM (Science, Technology, Engineering, and Math) and I knew I wanted to do something to make a difference in the world. I just didn’t know where to start. I was an immigrant in a new country, grew up in a tough environment, and wasn’t sure how… Read More