Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that determines whether a meeting room is in violation of fire law regulations regarding the maximum room capacity. The program will read

Write a program that determines whether a meeting room is in violation of fire law regulations regarding the maximum room capacity. The program will read in the maximum room capacity and the number of people to attend the meeting. If the number of people is less than or equal to the maximum room capacity, the program announces that it is legal to hold the meeting and tells how many additional people may legally attend. If the number of people exceeds the maximum room capacity, the program announces that the meeting cannot be held as planned due to fire regulations and tells how many people must be excluded in order to meet the fire regulations. INPUT and PROMPTS. The program uses this prompt "Enter the Maximum occupancy for the room." for the first number it reads in, the maximum room capacity. The program uses this prompt "Enter the number of occupants of the room." for the second integer read in, the number of occupants desired. After each number is input, the program should print the value read in. Each of the above should be printed on its own line. OUTPUT. If the desired number of occupants is legal the program prints "The number of occupants does not exceed the legal maximum." and terminates. Otherwise it prints out "ATTENTION: MAXIMUM OCCUPANCY EXCEEDED. THE LAW REQUIRES x PERSONS TO LEAVE THE ROOM IMMEDIATELY" and terminates. Here x is the number of people that must be excluded.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions