Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

ASSIGNMENT 3- Chapter 5 , #24 and #25 (p245 ,p246) -Use modular to simulate wind

ID: 3621556 • Letter: A

Question

ASSIGNMENT 3-
Chapter 5 , #24 and #25 (p245 ,p246)
-Use modular to simulate windspeeds and probability.
-Apply srand() function in the program.
-Record output to a datafile.
-Please add srand() function to assignment #3 and allow uses to enter the value of seed.
-Due date is 11/9.

FLIGHT SIMULATOR WIND SPEED.
This set of problems relates to a computer simulation of wind speed for a flight simulator.
Assume that the wind speed for a particular region can be modeled by using an average value
and a range of gust values that is added to the average. For example, the wind speed might be
10 miles an hour, with added noise (which represents gusts) that ranges from 22 miles per hour
to 2 miles per hour, as shown in Figure 5.16. Use the function randfloat developed in this
chapter.

24. Write a program to generate a data file named wind.dat that contains 1 hour of simulated
wind speeds. Each line of the data file should contain the time in seconds and the
corresponding wind speed. The time should start with 0 seconds. The increment in time should
be 10 seconds and the final line of the data file should correspond to 3,600 seconds.
The user should be prompted to enter the average wind speed and the range of values of the
gusts.

25. In problem 24, assume that we want the flight simulator wind data to include a 0.5%
possibility of encountering a small storm at each time step. Therefore, modify the solution
to Problem 24 so that the average wind speed is increased by 10 mph for a period of 5 minutes
when a storm is encountered.

Explanation / Answer

Dear, Here is the code 24. //Header file section #include #include #include #include #include using namespace std; //Function prototypes void Wind_Speed(); void Storms_Wind(); void Microbursts(); void View_Wind(); double rand_float(double a, double b); int main() { char selection; //do while to repeat untill quit operation selected do { system("cls"); cout