Data Structure Queue Project

Description

Hello, I need help with creating a project in C++. I attached one file with the instructions, one file with the rubric, and 3 files with code that you have to study. The final project has 7 files (as the instruction says). Programming language: C++, using Queues! You must comment your program properly – describe why you wrote each line of code in this way. I know that you can find answers in the Internet, do not do this. I will check it!

Don't use plagiarized sources. Get Your Custom Assignment on
Data Structure Queue Project
From as Little as $13/Page

Unformatted Attachment Preview

Project #2
Airport Runway Control Simulation
Focus on: queue operations, random number generator, queue
application, and object oriented design and programming.
TASK:
You will develop a program that acts as a simple air traffic control simulator
with one runway for landing and taking off. First, your program reads the
simulation parameters: time length, landing time, takeoff time, landing
arrival rate, and takeoff arrival rate. After running the simulation, your
program will output the number of airplanes landed, the number of airplanes
took off, average waiting time for landing, average time for taking off, and
the number of airplanes were denied for landing and the number of airplane
were denied for taking off. Notice: you have to make some modifications on
the runway class so that the class can be used for either landing or taking off.
REQUIREMENTS:
1.
You must have a program design file. You may suffer 10 %
percent penalty if you failed to do so.
2.
You must have a readme file that instructs readers how to compile
and run your program you may suffer 5 % percent penalty if you
failed to do so.
3.
You may use the queue template or your own queue class.
4.
Your program should produce correct results if input were correct,
otherwise, an error message should be given.
5.
You must comment your program properly (including proper
comments and program synopsis), otherwise you may suffer 10 %
percent penalty if you failed to do so.
6.
You should use class to address the Object Oriented Design and
Programming.
You need to turn in three source code files: runway.h, runway.cpp and
main.cpp.
The source code files posted attached are for you to study. Remember that
your project main function have to look like this:
int main()
{
Runway mine;
mine.start();
Return 0;
}
Which is different from the main function in the source code attached. So,
you have to study the source code and make needed modifications (majorly
creating a start function in the runway class).
Your program output have to look like this:
Enter the simulation length:
Enter landing time for an airplane:
Enter taking off time for an airplane:
Enter landing arrival rate:
Enter taking off arrival rate:
1000
20
25
0.1
0.2
Number of airplanes were landed:
50
Average waiting time for Landing was:
10
Number of airplanes were took off:
40
Average waiting time for taking off was:
34
Number of airplanes were denied for Landing:
Number of airplanes were denied for taking off:
50
160
Would you do it again (y/n): y
Show simulation results that look like the above… …
Would you do it again (y/n): n
Thank for using this program! Bye.
Your main function has to look like this:
OOP approach:
int main( )
{
runway mine;
mymin.start();
return 0;
}
UPLOAD FILES: program design file, your source code (runway.h,
runway.cpp and main.cpp.), readme file, testing data file, and program’s
output (screenshot).
#ifndef RUN_WAY_H_
#define RUN_WAY_H_
#include
class runway
{
public:
runway(int, int,float,float);//constructor
bool is_airplane_comming_for_landing();
bool is_airplane_comming_for_takeoff();
bool is_landing();
bool is_takeoff();
void one_time_unit();
bool is_runway_busy();
void start_takeoff();
void start_landing();
void sum_landing_time(int);
void sum_takeoff_time(int);
int airplane_landed();
int airplane_takeoff();
float average_wait_time_for_landing();
float average_wait_time_for_takeoff();
private:
float landing_arrivel_rate;//how often to come
float takeoff_arrivel_rate;//how often to come
int sum_for_landing;//store total time for landing
int sum_for_takeoff;//store total time for takeoff
int land_time;//store time used for landing
int takeoff_time;//store time used for taking off
int land_time_left;//store time left for landing
int takeoff_time_left;//store time left for takeoff
int takeoff_counter;//store the number of tookeoff
int landing_counter;//store the number of landed
};
#include “runway.cpp”
#endif
#include “runway.h”
#include
#include
using namespace std;
runway::runway(int takeoff, int landing, float
takeoff_rate, float landing_rate)
{
landing_arrivel_rate = landing_rate;
takeoff_arrivel_rate = takeoff_rate;
land_time = landing;
takeoff_time = takeoff;
takeoff_counter = 0;
landing_counter = 0;
sum_for_landing = 0;
sum_for_takeoff = 0;
land_time_left = 0;
takeoff_time_left = 0;
}
bool runway::is_airplane_comming_for_landing()
{
return (float)rand()/RAND_MAX < landing_arrivel_rate; } bool runway::is_airplane_comming_for_takeoff() { return (float)rand()/RAND_MAX < takeoff_arrivel_rate; } bool runway::is_landing() { return land_time_left > 0;
}
bool runway::is_takeoff()
{
return takeoff_time_left > 0;
}
void runway::one_time_unit()
{
if(is_landing())
land_time_left–;
if(is_takeoff())
takeoff_time_left–;
}
void runway::start_landing()
{
assert(!is_runway_busy());
land_time_left = land_time;
cout 0)
return (sum_for_takeoff / takeoff_counter);
}
int runway::airplane_landed()
{
return landing_counter;
}
int runway::airplane_takeoff()
{
return takeoff_counter;
}
#include
#include “runway.h”
#include
#include
using namespace std;
int main()
{
queue landing, takeoff;
int cur, next, land_time, takeoff_time, s_len;
float land_rate, takeoff_rate;
char answer[2];
do
{
couts_len;
coutland_rate;
couttakeoff_rate;
cout land_time;
cout takeoff_time;
runway mine(land_time, takeoff_time, land_rate,
takeoff_rate);
srand(time(NULL));
for( cur = 1; cur < s_len; cur++) { if(mine.is_airplane_comming_for_landing()) { cout Purchase answer to see full attachment