-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchair.cpp
44 lines (35 loc) · 848 Bytes
/
chair.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
#include "chair.h"
Chair::Chair() {};
//takes the order of each individual chair
void Chair::take_order(){
int i;
cout << "How many items? ";
cin >> counter;
for (i=0; i < counter; i++){
cout << "Item number " << i+1 << " is: " << endl;
cin >> order[i];
}
}
//makes the bill for each individual chair
void Chair::make_bill(){
string menu[ITEMS] = {"salad", "meatloaf", "nachos", "pizza", "burrito"};
int menu_price[ITEMS] = {10, 12, 8, 9, 10};
bill = 0;
int i, x;
for (i = 0; i < counter; i++){
x = 0;
while (order[i] != menu[x]){
x++;
}
bill += menu_price[x];
}
cout << bill << endl;
}
//returns the position of the chair
int Chair::pos_return(){
return position;
}
//assigns the position of the person ordering
void Chair::assign_position(int p){
position = p;
}