-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBar.cpp
More file actions
executable file
·31 lines (26 loc) · 853 Bytes
/
Bar.cpp
File metadata and controls
executable file
·31 lines (26 loc) · 853 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
#include "Bar.h"
Bar::Bar(){
}
/* Precondition: A Town has been initialized
Postcondition: maxcapacity variable is initialized for a given bar
Description: Bar Constructor
*/
Bar::Bar(int cap) {
maxcapacity = cap;
}
/* Precondition: maxcapacity is initialized
Postcondition: None
Description: Returns a bars maxcapacity
*/
int Bar::getBarCapacity() {
return maxcapacity;
}
/* Precondition: The number of Agents going to this specific bar has been decided.
Postcondition: The outcome of this bar(bar has won/lost) has been decided
Description: Using division, we divide the number of people going to this bar by
the bars maxcapacity in order return a number that shows what the bars capacity ratio
was for a specific round.
*/
double Bar::wonThisTurn(int peeps) {
return (((double)peeps)/((double)maxcapacity));
}