Question: Write a main() method that reads a sequence of integers from input and prints the smallest and largest numbers in the input and the summation

Write a main() method that reads a sequence of integers from input and prints the smallest and largest numbers in the input and the summation of the sequence. For example, if the input is 3 1 4 5 11 6 2 6 9, the program should print out: The smallest is 1, the largest is 11, and the sum is 47.

class Lab1 { public static void main(String[] args) { // Your code is here // Your code is here // Your code is here } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!