Question: Please use C++ in this problem. Write a program that prompts the user to enter the average rainfall for each month of the year. Then,
Please use C++ in this problem.
Write a program that prompts the user to enter the average rainfall for each month of the year. Then, prompt the user to enter the actual amount of rainfall for each month of this year. Finally, print out a table, formatted to be left justified with a width of 20 spaces for each column, that displays the average amount of rainfall, the actual amount of rainfall, and the difference between the two for each month of the year. Your program should use arrays to hold the values for average monthly rainfall, actual monthly rainfall, and month name.
Sample: EnteraveragemonthlyrainfallforJanuary:3.75 EnteraveragemonthlyrainfallforFebruary:9.12 EnteraveragemonthlyrainfallforMarch:7.02 EnteraveragemonthlyrainfallforApril:13.42 EnteraveragemonthlyrainfallforMay:2.01 EnteraveragemonthlyrainfallforJune:0.00 EnteraveragemonthlyrainfallforJuly:3.49 EnteraveragemonthlyrainfallforAugust:15.72 EnteraveragemonthlyrainfallforSeptember:12.17 EnteraveragemonthlyrainfallforOctober:1.22 EnteraveragemonthlyrainfallforNovember:0.11 EnteraveragemonthlyrainfallforDecember:1.11 Enterthisyear'srainfallforJanuary:13.24 Enterthisyear'srainfallforFebruary:9.76 Enterthisyear'srainfallforMarch:0.91 Enterthisyear'srainfallforApril:2.33 Enterthisyear'srainfallforMay:13.42 Enterthisyear'srainfallforJune:5.44 Enterthisyear'srainfallforJuly:0.67 Enterthisyear'srainfallforAugust:9.66 Enterthisyear'srainfallforSeptember:21.31 Enterthisyear'srainfallforOctober:17.49 Enterthisyear'srainfallforNovember:11.33 Enterthisyear'srainfallforDecember:0.22 MonthAvgRainfallThisYr'sRainfallDifference January3.7513.24-9.49 February9.129.76-0.64 March7.020.916.11 April13.422.3311.09 May2.0113.42-11.41 June05.44-5.44 July3.490.672.82 August15.729.666.06 September12.1721.31-9.14 October1.2217.49-16.27 November0.1111.33-11.22 December1.110.220.89
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
