forked from wns5255/STD_Algo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ride.h
51 lines (41 loc) · 1.02 KB
/
Ride.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
#ifndef __RIDE_H
#define __RIDE_H
#include "Person.h"
#include<iostream>
using namespace std;
static int cnt;
class Ride :public Person
{
int Rcost, Rnum, Rmin;
int Rage;//정원 9, min 10분
mutable int Rheight;
public:
Ride() { Rnum = 10, Rmin = 10, Rage = 14, Rheight = 150; }
Ride(int n, int m, int myAge) : Rnum(n), Rmin(m), Rage(myAge) {}
Ride(int n, int m, int myAge, int h) : Rnum(n), Rmin(m), Rage(myAge), Rheight(h) {} //오버로딩
void Check()
{
if (HeightCheck() == true)
{
if (Full(num) && WaitTime(min))
cout << "탑승하세요" << endl;
else if (WaitTime(min) == 0 or Full(num) == 0)
if (WaitTime(min) == 0)
cout << min % 10 << "분 뒤 탑승 가능" << endl;
else if (Full(num) == 0)
cout << "정원으로 인해 탑승 불가능" << endl;
}
else
cout << "키로 인해 탑승 불가능합니다." << endl;
}
bool Full(int n);
bool WaitTime(int m);
bool HeightCheck();
void WithParents();
int WPCReturn()
{
int a = GetWPC();
return a;
}
};
#endif