Question: in java, do not use public static void Homework: Largest of Three Let's use conditionals to perform a common task: finding the largest of, in
Homework: Largest of Three Let's use conditionals to perform a common task: finding the largest of, in this case, three numbers. You can imagine using this kind of code in a lot of places. Maybe you're picking the next person for your pickup basketball team and have the heights of three possible teammates. Maybe you're choosing between three medications and want to choose the best based on the results of some study. Or maybe you're choosing a steak to cook for dinner and want the heaviest cut of meat at the same price. In all cases the logic is the same. Assume you are working with three double variable: first, second, and third. Your code should print the value of the largest of the three. (If two or more values tie for the largest, you can print any of the largest values.) A You have until 11:59PM Central Time on 2021-02-07 to complete this problem WORKING PREVIOUS 3 4 5 6 7 B 9 10 i class Sorter 2 void max (double first, double second, double third) { if(first second) { if(first >- third) { System.out.println(first); } else if (third > first) { System.out.println(third); } } elsef if(second - third) { System.out.println(second); } else if (third >= second) System.out.println(third); 1 3 > 20 11 12 15 16 17 18 19 Ran 1 test. Stapped after finding 1 failure. Here is one: Testing largestofthree(double first -0.1, double second = -0.1, double third = -6.1) fa Solution printed: Submission printed
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
