Write a program whose inputs are three integers, and whose outputs are the largest of the three values and the smallest of the three values. Ex: If the input is: 7 15 3 the output is: largest: 15 smallest: 3 Your program must define and call the following two methods. The method largestNumber() should return the largest number of the three input values. The method smallestNumber() should return the smallest number of the three input values. public static int largestNumber(int num1, int num2, int num3) public static int smallestNumber(int num1, int num2, int num3) import java.util.Scanner; public class LabProgram { /* Define your method here */ public static void main(String[] args) { /* Type your code here. */}}
Write a
Ex: If the input is:
7 15 3
the output is:
largest: 15
smallest: 3
Your program must define and call the following two methods. The method largestNumber() should return the largest number of the three input values. The method smallestNumber() should return the smallest number of the three input values.
public static int largestNumber(int num1, int num2, int num3)
public static int smallestNumber(int num1, int num2, int num3)
import java.util.Scanner;
public class LabProgram {
/* Define your method here */
public static void main(String[] args) {
/* Type your code here. */
}
}
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images