Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle PL/SQL Programming Database Management Systems

Authors: Steven Feuerstein

1st Edition

978-1565921429

More Books

Students also viewed these Databases questions

Question

What is the difference between a cash inflow and a cash outflow?

Answered: 1 week ago