-In C Programming- Write a program to display the total rainfall for a year. In addition, display...

70.2K

Verified Solution

Question

Programming

-In C Programming-

Write a program to display the total rainfall for a year. Inaddition, display the average monthly rainfall, and the months withthe lowest and highest rainfall.

Create an array to hold the rainfall values. Create a 2ndparallel array (as a constant) to hold the abbreviated names of themonths. I created my arrays to be 1 element bigger than needed, andthen disregarded element [0] (so that my months went from [1] =\"Jan\" to [12] = \"Dec\").

Populate the array with the rainfall values entered by the user.Then, display the rainfall values. Display the 1st 6 months,followed by the last 6 months Then display the statistics (thetotal, average, lowest, and highest rainfall).

Calculate the total rainfall. After you get the total, youshould be able to calculate the average (use the size (minus 1 ifthe array was 1 element bigger than needed) of the array). Thenfind the index of lowest rainfall and the index of highestrainfall. Finally, display the statistics, using the indexes thatwere found to get the lowest and highest rainfall value and thename of the month from the arrays.

Format the output to 1 decimal place.

There is no validation.

Answer & Explanation Solved by verified expert
3.7 Ratings (460 Votes)
Programincludeint mainint    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students