-
Notifications
You must be signed in to change notification settings - Fork 0
/
capacity.cpp
36 lines (29 loc) · 961 Bytes
/
capacity.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
// Kaitlyn Lavan
// Sept. 19, 2017
// Code to determine room capacity
#include <iostream>
using namespace std;
int main()
{
//variables
int maximumCapacity, currentCapacity, morePeople, lessPeople;
//input
cout << "Enter the maximum room capacity due to fire regulations : ";
cin >> maximumCapacity;
cout << " Enter the current number of people present in the room : ";
cin >> currentCapacity;
// output and processing
if (currentCapacity <= maximumCapacity)
{
cout << "It is legal to hold this party." << endl;
morePeople = (maximumCapacity - currentCapacity);
cout << "The amount of additional guests that can attend this party is : " << morePeople << endl;
}
else
{
cout << "It is illegal to hold this party due to fire regulations." << endl;
lessPeople = -(maximumCapacity - currentCapacity);
cout << "The amount of guests that must be excluded is : " << lessPeople << endl;
}
return 0;
}