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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started