use vc++ to complete the programming project.... Number Array Version 1 (all int
ID: 649451 • Letter: U
Question
use vc++ to complete the programming project....
Number Array
Version 1 (all interactive). Write a program that reads in the average monthly rainfall for a city for each month of the year and then reads in the actual monthly rainfall for each of the previous 12 months. The program then prints out a nicely formatted table showing the rainfall for each of the previous 12 months as well as how much above or below average the rainfall was for each month. The average monthly rainfall is given for the months January, February, and so forth, in order. To obtain the actual rainfall for the previous 12 months, the program first asks what the current month is and then asks for the rainfall figures for the previous 12 months. The output should correctly label the months. There are a variety of ways to deal with the month names. One straight forward method is to code the months as integers and then do a conversion before doing the output. A large switch statement is acceptable in an output function. The month input can be handled in any manner you wish, as long as it is relatively easy and pleasant for the user.Explanation / Answer
#include #include using namespace std; int main () { double avgRainfall = 0; double totalRainfall = 0; double lowestRainfall; double highestRainfall; string lowestMonth; string highestMonth; string monthNames[] = {"January", "Febuary", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}; double monthlyTotals[12]; char repeat; do { coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.