Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**Student Name: Andrew Meade
- *Date Completed: 9/18/2014
- *Project No.: Chapter 2 PP; problem 5 on page 106
- *Project Description: Fire Regulation Room Capacity
- **/
- #include <iostream>
- using namespace std;
- int main()
- {
- //Declaring variables
- double capacity, attendees, overage;
- char ans;
- do
- {
- //Greeting the user and instructing them what to input.
- cout << "Hello! Please enter the room's maximum capacity.\n";
- cin >> capacity;
- cout << "Thank you. Now, please enter the number of people attending the meeting.\n";
- cin >> attendees;
- cout << "Thank you.\n";
- //An if/else statement to determine what course of action the program should take.
- if (attendees > capacity)
- {
- overage = attendees - capacity;
- cout << "The meeting can not be held as planned due to violation of";
- cout<< "\nfire safety regulations pertaining to an overage in maximum room capacity.\n";
- cout << overage;
- cout << " people will need to be excluded in order to meet regulation standards.\n";
- }
- else
- {
- cout << "It is legal to hold a meeting in this room if ";
- cout << attendees;
- cout << " people attend, since the room's maximum capacity is ";
- cout << capacity;
- cout << " as per fire regulation standards.\n";
- }
- cout << "Do you want to check another room?\nEnter Y for yes or N for no.\n";
- cin >> ans;
- //A repeating loop as long as they enter in the correct response to continue on
- }while (ans == 'Y'||ans == 'y');
- //Thanking the user for using the program
- cout << "Thanks for using the program! Goodbye!\n";
- system ("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement