Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ please leave comments For this program you will simulate the landing of airplanes on an airport runway. You will represent the airplane as: class

C++ please leave comments
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
For this program you will simulate the landing of airplanes on an airport runway. You will represent the airplane as: class Airplane public: string Name; int ArrivalTime int ApproachAndLandDelay; Airplane(string Aname, int AnApproachDelay, int Atime Name(Aname), ApproachDelay(AnApproachDelay), ArrivalTime(Atime) Using rand() from csdlib, which you will include as #include esdib>. You will generate random numbers to simulate the arrival time of each airplane at the airport. This can be coded as: arriva!Time rand() % 35. This statement will produce a (reproducible) arrival time in the range of 0 to 34 time units. After airplanes arrive ar the airport, they may have varying landing delays due to weather conditions or level of pilot experience. For each airplane this can be coded as: approach Delay (rand () % 2)-1. This statement will produce a landing delay time in the range of1 to 2 time units. Airplanes are numbered starting at 01, so names are: Airplane01, Airplane01, etc. You will benefit by doing this with C++ string objects, which require #include The function genAirplane0 will return a reference to an Airplane object and will calculate ArrivalTime, approachDelay and name the airplane. It will have a return statement: return *(new Airplane(airplaneName, approachDelay, ArrivalTime))

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions