subject

Write a program that lets the user enter the total rainfall for each of 12 months (starting with january) into an array of doubles. the program should calculate and display (in this order):

the total rainfall for the year,
the average monthly rainfall,
and the months with the highest and lowest amounts.

months should be expressed as english names for months in the gregorian calendar, i. e.: january, february, march, april, may, june, july, august, september, october, november, december.

input validation: do not accept negative numbers for monthly rainfall figures. when a negative value is entered, the program outputs "invalid data (negative rainfall) -- retry" and attempts to reread the value.

prompts and output labels: decimal values should be displayed using default precision, i. e. do not specify precision. each item read should be prompted for by a string of the form "enter rainfall for month: " where month is "january" or "february" or or "december". the output should be of the form:

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 20:00, manyah6189
Amanda needs to create an informative print brochure for her local library’s fundraiser dinner. what critical detail must she have before she starts designing the brochure?
Answers: 1
image
Computers and Technology, 23.06.2019 16:00, natasniebow
Kenny works with an it company. his company is about to launch new software in the market. he has to ensure that this new software is functional and meets all of the quality standards set up at the planning stage. which job profile is kenny likely to have? kenny is likely to have the job profile of a blank .
Answers: 2
image
Computers and Technology, 23.06.2019 16:30, saintsfan2004
How to do this programming flowchart?
Answers: 3
image
Computers and Technology, 23.06.2019 21:00, kkpsmith
Alcohol’s affects on the cornea and lens of the eye make it more difficult
Answers: 1
You know the right answer?
Write a program that lets the user enter the total rainfall for each of 12 months (starting with jan...

Questions in other subjects:

Konu
Chemistry, 01.07.2020 15:01