Question: Write a method called smallestLargest that accepts a Scanner for the console as a parameter and asks the user to enter numbers, then prints the
Write a method called smallestLargest that accepts a Scanner for the console as a parameter and asks the user to enter numbers, then prints the smallest and largest of all the numbers supplied by the user. You may assume that the user enters a valid number greater than 0 for the number of numbers to read. Here is a sample execution:
How many numbers do you want to enter? 4
Number 1: 5
Number 2: 11
Number 3: -2
Number 4: 3
Smallest = -2
Largest = 11
Step by Step Solution
3.49 Rating (159 Votes )
There are 3 Steps involved in it
public static void smallestLargest Systemoutprint How many numbers do ... View full answer
Get step-by-step solutions from verified subject matter experts
