write this code using VISUAL STUDIO. Also write the code in a SEPARATE FILES.
For Part 2, you will implement the code for your airport simulation. See Airport Project Part 1 for the project requirements. Your code will use linked data structures (pointers, not arrays). You must implement at least one priority queue and one stack.
Submit one .cpp file for each class, one .h file for each class, and one .cpp file for your menu and app code.
Code Standards:
- Our usual coding guidelines apply
- Code must be readable, with white space between logical units
- Variable names must be meaningful
- Code is properly indented, and tabs line up properly
- Comments must be plentiful and appropriate
USE THIS CODE TO COMPLETE THE ASSIGNMENT
#include <iostream>
#include <conio.h>
#include <cstdio>
#include <cstring>
#include <cstdlib>
using namespace std;
struct n // node declaration
{
int priority;
char info;
struct n *next;
};
class Priority_Queue
{
private:
n *f;
public:
Priority_Queue()
{
f = NULL;
}
void insert(char str[], int i, int p)
{
n *t, *q;
t = new n;
t->info = i;
t->priority = p;
if (f == NULL || p < f->priority)
{
t->next = f;
f = t;
}
else
{
q = f;
while (q->next != NULL && q->next->priority <= p)
q = q->next;
t->next = q->next;
q->next = t;
}
}
void delet()
{
n *t;
if (f == NULL) //if queue is null
cout << “Queue Underflown”;
else
{
t = f;
cout << “Deleted item is: ” << t->info << endl;
f = f->next;
free(t);
}
}
void show() //print queue {
{
n *ptr;
ptr = f;
if (f == NULL)
cout << “Queue is emptyn”;
else
{
cout << “Queue is :n”;
cout << “Priority Itemn”;
while (ptr != NULL)
{
cout << ptr->priority << ” ” << ptr->info << endl;
ptr = ptr->next;
}
}
}
};
int main()
{
int c, p, i;
char str[3];
Priority_Queue pq;
do
{
cout << “1.Insertn”;
cout << “2.Deleten”;
cout << “3.Displayn”;
cout << “4.Exitn”;
cout << “Enter your choice : “;
cin >> c;
switch (c)
{
case 1:
cout << “Input the plane to be added in the queue in terms of C for commercial, A for airforce1 and P for private plane: “;
cin >> str;
cout << “Enter the priority in terms percentage without the sign % : “;
cin >> i;
cout << “Enter the priority in terms percentage without the sign % : “;
cin >> p;
pq.insert(str, i, p);
break;
case 2:
pq.delet();
break;
case 3:
pq.show();
break;
case 4:
break;
default:
cout << “Wrong choicen”;
}
} while (c != 4);
return 0;
}








Jermaine Byrant
Nicole Johnson



