CS 1181

  

CS 1181

Upload the following programs using your Moodle account.

Asg6a.cpp

Write a program to store the results of a lab experiment involving daily temperatures in a text file named temperatures.txt. Prompt the user for the 6:00AM, Noon, and 6:00PM temperatures for a period of 7 days. The temperatures cannot be less than -50 or greater than 110. Write each temperature to the file using the following format:

field 1: day

field 2: 6:00AM temperature

field 3: Noon temperature

field 4: 6:00PM temperature

The file should have 7 records, one for each day.

NOTE: Store the temperatures.txt file in the same folder as the program source code.

Asg6b.cpp

Write a program to read the temperatures.txt file you created for asg6a and create a temperature report for each day with an average for each period using the following format:

Day Morning Noon  Evening

1 45 63 57

7 41 57 43

Average  nn.n nn.n  nn.n

Tags: No tags