Question: MUST be in JAVA. Write a program that uses a Scanner object to read a sequence of numbers that represent the temperatures for a number

MUST be in JAVA.

Write a program that uses a Scanner object to read a sequence of numbers that represent the temperatures for a number of days (entered on a single line).

The program will first read in an int that represents how many temperatures are to be entered. Then the program will read that many doubles representing temperatures. You can assume at least one temperature is entered. The program will then print the lowest and highest temperature, and the average temperature on one line (use printf to print 2 decimals).

Details

Input

An integer n representing the number of temperatures to be read in, followed by n temperatures (as doubles).

Output

The lowest, highest and average temperature.

Sample input: 5 -21 4.9 10 5.5 2.2 Sample output: -21.00 10.00 0.32

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!