-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
109 lines (87 loc) · 3.21 KB
/
main.cpp
File metadata and controls
109 lines (87 loc) · 3.21 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#include <iostream>
#include "string"
#include "cmath"
#include "../Final Project v3/Concessions/ConcessionItem.h"
#include "../Final Project v3/Concessions/ConcessionStand.h"
#include "../Final Project v3/Boxoffice/BoxOffice.h"
#include "../Final Project v3/Boxoffice/TheaterRoom.h"
#include "Movie.h"
using namespace std;
int main() {
Movie* movie1 = new Movie("Averngers", "Action", 4.5, 2.0);
Movie* movie2 = new Movie("Happy Gilmore", "Comedy", 4.7, 1.6);
Movie* movie3 = new Movie("Ice Age", "Family", 3.0, 1.5);
Movie* movie4 = new Movie("Get Out", "Horror", 2.7, 1.8);
Movie* movie5 = new Movie("Star Wars", "Sci Fi", 5.0, 1.75);
std::cout<<"------------Welcome To Your Movie Theater------------"<<std::endl;
std::cout<<"Type /help if you need a list of commands!"<<std::endl;
string command;
string foodItem;
int numOfFood;
int totalIncome;
int numOfTickets;
int newTicketPrice;
ConcessionStand* food = new ConcessionStand();
BoxOffice* BO = new BoxOffice();
float price = BO->getTicketPrice();
getline(cin,command);
int end = 0;
while(end == 0){
if(command == "/help"){
cout<<"--------List of Commands:--------"<<endl;
cout<<"/quit"<<endl;
cout<<"/1 -> Change Ticket Price"<<endl;
cout<<"/2 -> Get Ticket Price"<<endl;
cout<<"/3 -> Sell Tickets"<<endl;
cout<<"/4 -> Total Tickets Sold"<<endl;
cout<<"/5 -> Get Total Income"<<endl;
cout<<"/6 -> Current Movies playing"<<endl;
cout<<"/7 -> Sell Concession Item"<<endl;
cout<<"Enter a number: "<<endl;
getline(cin,command);
}
if(command == "/quit"){
return 0;
}
if(command == "1"){
std::cout<<"Current ticket price: "<< BO->getTicketPrice()<<std::endl;
cout<<"Change price to: "<<endl;
std::cin>> newTicketPrice;
BO->changeTicketPrice(newTicketPrice);
price = BO->getTicketPrice();
}
if(command == "2"){
cout<<"Ticket price is: "<< BO->getTicketPrice() <<endl;
}
if(command == "3"){
cout<<"Enter Number of Tickets Sold: "<<endl;
//std::cin>> numOfTickets;
//for(int i=0; i<numOfTickets;i++) {
// BO->updateTicketsSold();
//totalIncome += BO->getTicketPrice();
// }
}
if(command == "4"){
//std::cout << BO->getTicketsSold() << " Tickets were sold!"<<std::endl;
}
if(command == "5"){
cout<<"Total income is: "<< totalIncome <<endl;
}
if(command == "6"){
cout<<"The current movies playing are: "<<endl;
BO->getMoviesPlaying();
}
if(command == "7"){
cout<<"What concession item did you sell"<<endl;
cout<<"Fritos"<<endl;
cout<<"Pepsi"<<endl;
getline(cin,foodItem);
cout<<"How many sold:"<<endl;
std::cin>> numOfFood;
food->itemSold(foodItem,numOfFood);
}
command = "";
cout<<"Enter a command number or /help: "<<endl;
getline(cin,command);
}
}