Write a C++ program that reads in the historical average monthly rainfall for NY for each month of the year and then reads in the actual monthly rainfall for each month in 2007. Finally, the program should print out a nicely formatted table showing the average rainfall for each month, the total rainfall for each month of 2007, and how much above or below average the rainfall was for each month. The output should correctly label the months.
Your program should give the user the option of entering all data from the command line or reading the data from directly from two files. Data files for this problem can be downloaded using the following commands:
There are a various ways of dealing with the month names. One straightforward way is to code the months as integers and then do a conversion before doing output. A large switch statement is acceptable in an output function. The month-by-month input for manual data entry can be done any way you like, so long as it is relatively easy and pleasant for the user.
Be sure to make good use of functions in your program. At a minimum, you should include separate functions for each input method and for generating the results. You may also decide to create a function for outputting the month names.