Write a program that asks the user for the rain fall for three months, April, May, and June and then prints out the results in a table as shown below. Declare and initialize a variable to the rain fall for each month. Compute the average, and write out the results, something like:
Rainfall for April: 12
Rainfall for May : 14
Rainfall for June: 8
Average rainfall: 11.333333
To get the numerical values to line up use the tabulation character '\t' as part of the character string in the output statements. Check that your program prints the correct results.
Have the user enter the data for each month. Use rainfall statistics from Weather.com or another weather related site. Use a while loop to allow the user to continue or stop.
Look at EscapeSequences for help on the \t
Comments (0)
You don't have permission to comment on this page.