-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflight.h
More file actions
64 lines (52 loc) · 1.43 KB
/
flight.h
File metadata and controls
64 lines (52 loc) · 1.43 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
https://powcoder.com
代写代考加微信 powcoder
Assignment Project Exam Help
Add WeChat powcoder
#ifndef _FLIGHT_H_
#define _FLIGHT_H_
#include <string>
#include <vector>
#include <algorithm>
class FlightPlanner {
std::vector<std::shared_ptr<FlightPlan>> flightplan;
std::vector<std::string> airport;
std::vector<std::shared_ptr<Flight>> flights;
public:
FlightPlanner() {}
void addAirport(const std::string &name);
void addFlight(const std::string &from, const std::string &to, int duration, int price, const std::string &name);
std::vector<std::shared_ptr<FlightPlan>> planTrip(const std::string &from, const std::string &to);
void findTrip(const std::string &from, const std::string &to, std::vector<std::shared_ptr<Flight>> visited);
};
class FlightPlan {
std::vector<std::shared_ptr<Flight>> plan;
int duration;
int price;
int pain;
public:
//return flight in the flightplan
std::vector<std::shared_ptr<Flight>> getSteps();
int getDuration();
int getPrice();
int getPain();
void setPrice();
void setDuration();
void setPain();
};
class Flight {
std::string from;
std::string to;
int duration;
int price;
std::string name;
public:
Flight(std::string from, std::string to, int duration, int price, std::string name);
std::string getFrom();
std::string getTo();
int getDuration();
int getPrice();
std::string getName();
};
class FlightNameException {
};
#endif