/*************************************************************************** * Name: * NetID: * Precept: * * Description: Maxi reads three integers from standard input. Then it * finds the maximum value. Then it converts these three integers to quotients * and finds the maximum of those values. What will the output of this code * always be? * * Remarks: Notice that both functions have the same name. * -- How does Java know which max3() you mean when you call max3(1, 2, 3)? * -- What would happen if you called max3(1, 2, 3.0)? **************************************************************************/ public class Maxi { // return the maximum of three integers public static __________ max3(_________________________________) { StdOut.println("debugging: running the first method"); } // return the maximum of three doubles public static __________ max3(_________________________________) { StdOut.println("debugging: running the second method"); } public static void main(String[] args) { // read three integers from standard input int num1 = StdIn.readInt(); int num2 = StdIn.readInt(); int num3 = StdIn.readInt(); // call the function max3(a, b, c) to find the largest int largest = max3(num1, num2, num3); // make three quotients with largest as the denominator double q1 = (double) num1 / largest; double q2 = (double) num2 / largest; double q3 = (double) num3 / largest; // print the largest quotient System.out.println(max3(q1, q2, q3)); } }