Write a program that asks the user to enter five


Question 1
Write a program that can be used as a math tutor. The program should display two random numbers between 1 and 99 to be added, such as
20
+ 33
After the student has entered an answer and pressed the [Enter] key, the program should display the correct answer so the student can see if his/her answer is correct.

Question 2

Write a program that calculates the average rainfall for three months. The program should ask the user to enter the name of each month, such as June or July, and the amount of rain (in millimeters) that fell each month. The program should display a message similar to the following:

The average rainfall for June, July, and August is 6.72 millimeter.

Question 3

Modify the program you wrote for Question 2 (Average Rainfall) so it reads its input from a file instead of the keyboard.

Question 4

Program 1: Write a program that asks the user to enter five floating-point numbers. The program should create a file and save all five numbers to the file.

Program 2• The program should open the file created in Program 1 and ask the user to enter another five floating-points numbers and save all five numbers to the file, calculate the average of all ten numbers in the file and finally display the average and save the average to the file.

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Write a program that asks the user to enter five
Reference No:- TGS0664283

Now Priced at $40 (50% Discount)

Recommended (91%)

Rated (4.3/5)