-
Notifications
You must be signed in to change notification settings - Fork 0
/
Person.h
77 lines (65 loc) · 1.66 KB
/
Person.h
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
//////////////////////////////////
/* Ahmet Polat */
/* 150170109 */
/* 01/05/2021 */
//////////////////////////////////
#pragma once
#include <iostream>
using namespace std;
class Person{
protected:
string name, surname;
public:
Person(string="", string="");
//getters setters
string getName() const{
return name;
}
string getSurname() const{
return surname;
}
void setName(string name){
this->name = name;
}
void setSurname(string surname){
this->surname = surname;
}
};
class Passenger:public Person{
private:
int cash;
bool ticket;
public:
Passenger(string="", string="", int=0);
Passenger(const Passenger&);
bool buyTicket(int);
//getters setters
int getCash() const{
return cash;
}
bool getTicket() const{
return ticket;
}
void setCash(int cash){
this->cash = cash;
}
void setTicket(bool ticket){
this->ticket = ticket;
}
};
class Astronaut:public Person{
private:
int numMissions;
public:
Astronaut(string="", string="", int=0);
Astronaut(const Astronaut&);
void completeMission();
//getters setter
int getNumMissions() const{
return numMissions;
}
void setNumMissions(int numMissions){
this->numMissions = numMissions;
}
};
//