-
Notifications
You must be signed in to change notification settings - Fork 0
/
film.cpp
54 lines (44 loc) · 950 Bytes
/
film.cpp
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
/*
film.cpp
Author: M00776456
Created: 06/01/22
Updated: 13/01/22
*/
#include "events.h"
#include "film.h"
// constructor
Film::Film() : Event()
{
}
Film::Film(details* array) : Event(array)
{
setType(array->filmType);
}
// setter
void Film::setType(std::string filmType)
{
type = filmType;
}
// return film type
std::string Film::getType()
{
return type;
}
// booking for film event
void Film::booking(int seatToBeBooked)
{
setAvailableSeat(getAvailableSeat() - seatToBeBooked);
}
// cancel booking for film event
void Film::cancel(int seatsToCancel)
{
setAvailableSeat(getAvailableSeat() + seatsToCancel);
}
// desciption for film event
std::string Film::description()
{
return "Film " + getName() + " of film type " + getType() +
" has " + std::to_string(getAvailableSeat()) +
" available seats out of " + std::to_string(getMaxCapacity()) +
" seats.";
}