Question: For these two assignments (Program 12 and Program 13), you will use the same data file but your programs will process the file in different
For these two assignments (Program 12 and Program 13), you will use the same data file but your programs will process the file in different ways. Data file The data file linked for the assignment is weatherdata.txt. This file contains wind speed and temperature data for 30 days. The first value on each line is the day - day 1, day 2, day 3, etc., up to day 30. The second value on the line is the wind speed in knots - 14 knots for day 1, 12 knots for day 2, etc., up to 14 knots for day 30. The third value on the line is the temperature in Celsius - 25 c for day 1, 31 c for day 2, etc., up to 22 c for day 30. For Programs 12 and 13, you will read this data and process it to produce the average wind speed and the average temperature once without using arrays and once with using arrays. In either case your output can be very simple: See the details for each below. Program 12 For this program you will read the data in the file, using it to calculate and output the average wind speed and the average temperature. Do not store the data in arrays (or any other structure). You should have not more than one days worth of data stored at any one time. Calculate your sum as you go. Do not program this with a hard coded value of 30 used as the divisor to produce your averages. Maintain a count as you go. Program 13 For this program you will read the data in the file into arrays for the wind speed and for the temperature, then use the stored data to calculate and output the average wind speed and the average temperature. Create a constant with a value of 30 and use that to declare and loop through your arrays and as a divisor to produce your averages. Turn in both programs at the assignment link to complete the assignment.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
