-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSimulator.cpp
More file actions
102 lines (90 loc) · 2.8 KB
/
Simulator.cpp
File metadata and controls
102 lines (90 loc) · 2.8 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#include <bits/stdc++.h>
#include <unistd.h>
#include "Model/Astronaut.h"
#include "SpaceMission.h"
#include "HumanSpaceMission.h"
#include "Satellite.h"
#include "Sensors.h"
#include "ControlUnit.h"
#include "SpaceMission.h"
#include "Rover.h"
using namespace std;
void simulate1(SpaceMission *mission, ControlUnit *c1)
{
((Rover *)mission)->load_rover_in_rocket();
((Rover *)mission)->check_successful_loading();
c1->check_payload();
c1->check_all_system_status();
c1->iniatialising_launch_sequence();
c1->mission_success();
}
void simulate2(SpaceMission *mission, ControlUnit *c1)
{
c1->check_all_system_status();
c1->iniatialising_launch_sequence();
c1->mission_success();
}
void simulate3(SpaceMission *mission, ControlUnit *c1)
{
((Satellite *)mission)->load_the_satellite();
((Satellite *)mission)->check_successful_loading();
c1->check_payload();
c1->check_all_system_status();
c1->iniatialising_launch_sequence();
c1->mission_success();
}
int main()
{
ControlUnit *c1;
cout << " Welcome to INDIAN SPACE RESEARCH ORGANIZATION\n\n ";
sleep(1);
SpaceMission *mission;
cout << " Select Type of SPACE MISSION: \n" << endl;
sleep(1);
cout << " 1. Rover Launch Mission" << endl;
sleep(1);
cout << " 2. Sattelite Launch Mission" << endl;
sleep(1);
cout << " 3. Human Space Mission\n"
<< endl;
sleep(1);
cout << " 🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀\n";
sleep(1);
cout << " 🚀🚀 1--> TAKES A ROVER TO A PLANET 🚀🚀\n";
sleep(1);
cout << " 🚀🚀 2--> TAKES SATELLITE TO ORBIT OF EARTH 🚀🚀\n";
sleep(1);
cout << " 🚀🚀 3--> FOR INTER PLANATORY MAN MISSIONS 🚀🚀\n";
sleep(1);
cout << " Enter the tpye of mission You want to go on with ISRO...\n\n";
cout << " CHOICES any 1 of 3 missions (1/2/3) : \n";
string input;
cin >> input;
// sleep(1);
while (input != "1" | input != "2" | input != "3")
{
if (input == "1")
{
mission = new Rover();
simulate1(mission, c1);
break;
}
else if (input == "2")
{
mission = new Satellite();
simulate3(mission, c1);
break;
}
else if (input == "3")
{
mission = new HumanSpaceMission();
simulate2(mission, c1);
break;
}
else
{
cout << "Press the correct key to prceed into ISRO Rocket launch mission : ";
cin >> input;
}
}
}