-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainExecution.java
201 lines (170 loc) · 5.65 KB
/
MainExecution.java
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
import java.util.Scanner;
public class MainExecution
{
String hotel = "" ;
double cost = 0.0 ;
public void main(String args[])
{
Scanner sc = new Scanner(System.in);
//creating the objects
InputDetails obj1 = new InputDetails();
AirplaneSeatReservation obj2 = new AirplaneSeatReservation();
TrainSeatReservation obj3 = new TrainSeatReservation();
AarogyaSetuApplication obj4 = new AarogyaSetuApplication();
HotelRoomReservation obj5 = new HotelRoomReservation();
PreBookMeals obj6 = new PreBookMeals();
//member methods of InputDetails
obj1.displayWelcome();
obj1.name();
obj1.nameCapital();
obj1.OtherDetails();
//member method of AarogyaSetuApplication
obj4.ArogyaSetuApplication();
if(obj4.arogyaSetu == true)
{
//displaying the details for transportation
System.out.println("\f");
System.out.println("We would like to display a few modes of transportaion options for your travel");
System.out.println("Please select your mode of transportation: ");
System.out.println("(1) for Aeroplane \n(2) for railways \n(3) for private transport");
int ans = sc.nextInt();
if( ans == 1)
{
//member methods of AirplaneSeatReservation
obj2.displayAirplaneSeats();
obj2.Choose(obj1);
}
else if ( ans == 2)
{
//member methods of TrainSeatReservation
obj3.accept();
obj3.update();
obj3.display(obj1);
}
else
{
//nothing is to be done
}
//displaying the details for hotel reservation
sc.nextLine().trim();
System.out.println("\n\nDo you want to reserve a room?");
if(sc.nextLine().equalsIgnoreCase("yes"))
{
//member methods of HotelRoomReservation
obj5.hotelRoomRerservation(obj1);
//display the details for Prebook meals
System.out.println("Do you want to prebook meals? (yes/no)");
if(sc.nextLine().trim().equalsIgnoreCase("yes"))
{
//member methods of PreBookMeals
obj6.peopleCapacity(obj1);
obj6.peopleCapacityCheck(obj1);
obj6.timeReserve();
obj6.tableReserve();
obj6.tableCheck();
obj6.finalDisplay(obj1);
}
}
//displaying the estimates for the trip
cost = obj2.cost + obj3.cost + obj5.cost + obj6.bill;
System.out.println();
// displaying name
System.out.println("Name: " + obj1.name);
try{
Thread.sleep(1000);
}
catch(Exception e)
{
}
//displaying date of travel
System.out.println("Date of travel: " + obj1.date);
try{
Thread.sleep(1000);
}
catch(Exception e)
{
}
//displaying phone number
System.out.println("Phone Number: " + obj1.phoneNumber );
try{
Thread.sleep(1000);
}
catch(Exception e)
{
}
//displaying current location
System.out.println("Current Location: " + obj1.currentLocation);
try{
Thread.sleep(1000);
}
catch(Exception e)
{
}
//displaying destination
System.out.println("Destination: " + obj1.destination);
try{
Thread.sleep(1000);
}
catch(Exception e)
{
}
//displaying cost of flights
if(obj2.cost > 0)
System.out.println("Cost for Flight: " + obj2.cost);
try{
Thread.sleep(1000);
}
catch(Exception e)
{
}
//Displaying the cost of train
if( obj3.cost > 0 )
System.out.println("Cost for Train: " + obj3.cost);
else
System.out.print("");
try{
Thread.sleep(1000);
}
catch(Exception e)
{
}
//displaying the cost of room
if( obj5.cost > 0)
System.out.println("Cost for Room: " + obj5.cost);
try{
Thread.sleep(1000);
}
catch(Exception e)
{
}
//displaying the cost of meals
if ( obj6.bill > 0)
System.out.println("Cost of Meals: " + obj6.bill);
try{
Thread.sleep(1000);
}
catch(Exception e)
{
}
//displaying the total cost of the trip
System.out.println("\nCost of your Trip: " + cost);
finalDisplay();
}
}
String finalDisplay = "Thank You Hoping To See You Soon ☺" ;
void finalDisplay()
{
for(int i = 0 ;i < finalDisplay.length() ; i++)
{
char ch = finalDisplay.charAt(i);
System.out.print(ch);
try
{
Thread.sleep(150);
}
catch(Exception e)
{
}
}
}
}