-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathmain.cpp
More file actions
38 lines (35 loc) · 932 Bytes
/
Copy pathmain.cpp
File metadata and controls
38 lines (35 loc) · 932 Bytes
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
// Main.cpp
// Tying it all together
#include <iostream>
#include "elevator.h"
#include "lobby.h"
#include <string>
using namespace std;
int main(){
cout << "Let's set up. How many elevators would you like?" << endl;
int num_elev, num_floors;
cin >> num_elev;
cout << "How many floors are in this building?" << endl;
cin >> num_floors;
Lobby l = Lobby(num_elev, num_floors);
cout << "Great, now we are up and running." << endl;
bool done = false;
while(not done){
int floor;
string direction;
cout << "What floor are you on?" << endl;
cin >> floor;
cout << "What direction would you like to go?" << endl;
cin >> direction;
cout << "Processing your request now." << endl;
l.generate_request(direction, floor);
if(l.no_requests()){
int input;
cout << "All requests processed. To exit, type -1. Choose 1 for another request" << endl;
if(input == -1){
done = true;
}
}
}
return 0;
}