forked from shlokshah/ROS1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathROS 1.0.1
86 lines (75 loc) · 1.8 KB
/
ROS 1.0.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#include<iostream>
#include<time.h>
#include<stdlib.h>
#include<stdio.h>
using namespace std;
bool runwayfree=true;
struct plane
{
string name;
int fuel;
int passengers;
int staff_present;
int staff_required; //Total requirement for it to be able to fly
bool priority=false;
};
int staff_available=3; //staff available on the ground ready to fly
int numberplanes;
int n;
struct plane a[10];
void enterdetails()
{
srand (time(0));
cout<<"Enter number of planes arriving at the Airport: ";
cin>>n;
for(int i=0;i<n;i++)
{
cout<<"\n Enter plane name for plane "<<i+1<<": ";
cin>>a[i].name;
cout<<" Enter number of passengers in plane "<<a[i].name<<": ";
cin>>a[i].passengers;
char priority_choice;
cout<<" Is it a VIP plane?(y/n): ";
cin>>priority_choice;
if(priority_choice=='y'||priority_choice=='Y')
{
a[i].priority=true;
}
else if(priority_choice=='n'||priority_choice=='N')
{
a[i].priority=false;
}
else
{
cout<<"Invalid Input";
}
a[i].fuel=(rand() % 100 + 50)%100;
cout<<" Fuel in Plane "<<a[i].name<<": "<<a[i].fuel;
a[i].staff_present=rand() % 10 + 3;
cout<<endl<<" Staff present in plane "<<a[i].name<<" is: "<<a[i].staff_present<<"\n";
}
}
void land_check()
{
}
/*void staff_offload(plane A)
{
staff_available=staff_available + A.staff_present;
A.staff_present=0;
}
void staff_loading(plane A)
{
if(A.staff_required>staff_available)
{
cout<<"Complete staff no available right now! please wait";
}
else
{
A.staff_present=A.staff_required;
staff_available=staff_available-A.staff_required;
}
}*/
int main()
{
enterdetails();
}