Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

5 . 4 LAB: Loops: For Loop Precipitation Analytics ( LT - C - SP 2 4 ) Write a program that first read in

5.4 LAB: Loops: For Loop Precipitation Analytics (LT-C-SP24)
Write a program that first read in an integer that is the number of days of data on precipitation to read from the input. Write a for loop that reads in the amount of precipitation on each of those days and accumulates the total precipitation. Display the total precipitation, and the average precipitation per day. The average precipitation per day must be displayed with 2 decimal places. For full credit, you must use a for loop.
Recall to output a value with 2 decimal places you need to add the following on the Put to output statement: with 2 decimal places.
Ex: If the input is:
32.34.75.1
the output is:
Total =12.1
Average =4.03
Ex: If the input is:
62.14.32.83.42.19.2
the output is:
Total =23.9
Average =3.98

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions

Question

9. Describe the characteristics of power.

Answered: 1 week ago

Question

3. Identify and describe nine cultural value orientations.

Answered: 1 week ago