-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
53 lines (43 loc) · 1.32 KB
/
Copy pathmain.cpp
File metadata and controls
53 lines (43 loc) · 1.32 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
#include <iostream>
#include "FlightManager.h"
#include "Menu.h"
int main() {
FlightManager manager;
manager.loadFromFile();
Menu menu(manager);
int choice;
do {
menu.displayMenu();
std::cout << "Въведете вашия избор: ";
std::cin >> choice;
if (std::cin.fail()) {
std::cin.clear();
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
std::cout << "Невалиден избор. Моля въведете число.\n";
continue;
}
switch (choice) {
case 1:
menu.handleAddAircraft();
break;
case 2:
menu.handleAddFlight();
break;
case 3:
menu.handleViewAllAircrafts();
break;
case 4:
menu.handleViewAllFlights();
break;
case 5:
menu.handleFindFlightsByDestination();
break;
case 6:
std::cout << "Довиждане!" << std::endl;
break;
default:
std::cout << "Невалиден избор. Моля опитайте отново." << std::endl;
}
} while (choice != 6);
return 0;
}