Question: // ConsoleApplication66.cpp : Defines the entry point for the console application. // Flight simulator program #include stdafx.h #include #include #define RAND_MAX 32768 #define N 25

 // ConsoleApplication66.cpp : Defines the entry point for the console application.

// ConsoleApplication66.cpp : Defines the entry point for the console application.

// Flight simulator program

#include "stdafx.h"

#include

#include

#define RAND_MAX 32768

#define N 25

int main()

{

unsigned int seed;

double aver_wind_speed, gusts;

double wind_speed_plus_gusts[N];

double rand_float(double a, double b);

int i;

printf("Enter the average wind speed: ");

scanf_s("%lf", &aver_wind_speed);

printf("Enter unsigned integer:");

scanf_s("%u", &seed);

srand(seed);

printf("Time \t Wind Speed ");

for (i = 0; i

gusts = rand_float(-2, 2);

/* if ((i >= 5 && i = 15 && i

else aver_wind_speed = 10; */ /* Include these two lines when you want to simulate wind speeds with storms */

wind_speed_plus_gusts[i] = aver_wind_speed + gusts; /* Windspeeds without storms, but having the normal

flight turbulence */

printf("%d \t %.2f ", i, wind_speed_plus_gusts[i]);

}

return 0;

}

double rand_float(double a, double b) {

return((double) rand() / RAND_MAX)*(b - a) + a;

}

Instructions: C++ a) Use scanf function to accept the input from the user. b) Use floating point inputs wherever possible c) All programs must use arrays and functions. d) Tabulate your results. e) Need hard copy of (i) source code and (ii) output for each program 1. Redo the flight simulator program (using functions) that we did in Lab 7. Plot the wind speed when (a) there is no storm, (b) when there are 3 storms with varying intensities. You can choose the time between which storms occur

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!