5. Write a program that determines whether a meeting room is in violation of fire law regulations regarding the maximum room capacity. The pro- gram will read in the maximum room capacity and the number of people attending 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 regula- tions and tells how many people must be excluded in order to meet the fire regulations. For a harder version, write your program so that it allows the calculation to be repeated as often as the user wishes. If this is a class exercise, ask your instructor whether you should do this harder version.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question
### Programming Exercise: Meeting Room Capacity Check

**Objective:**

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

**Instructions:**

1. **Input Requirements:**
   - The program should read the **maximum room capacity**.
   - The program should read the **number of people** attending the meeting.

2. **Program Logic:**
   - If the number of people is **less than or equal to** the maximum room capacity:
     - The program should announce that it is legal to hold the meeting.
     - Inform how many additional people may legally attend.
   - If the number of people **exceeds** the maximum room capacity:
     - The program should announce that the meeting **cannot be held** as planned due to fire regulations.
     - Inform how many people must be excluded to meet the fire regulations.

3. **Advanced Version:**
   - For a more challenging task, modify your program to allow the calculation to be repeated as often as the user wishes.
   - If this is a class exercise, consult your instructor to determine whether to attempt this version.

---

**Example Pseudocode:**

``` pseudocode
BEGIN
  READ max_capacity
  READ num_people

  IF num_people <= max_capacity THEN
    PRINT "It is legal to hold the meeting."
    PRINT "Additional people that may legally attend: ", max_capacity - num_people
  ELSE
    PRINT "The meeting cannot be held due to fire regulations."
    PRINT "Number of people to exclude: ", num_people - max_capacity
  ENDIF

  PRINT "Do you want to perform another calculation? (yes/no)"
  READ user_response
  IF user_response == "yes" THEN
    REPEAT the above steps
  ELSE
    EXIT
  ENDIF
END
```

Use this pseudocode as a guide to implement the solution in your preferred programming language. This task will help reinforce concepts related to conditional statements and user input handling.
Transcribed Image Text:### Programming Exercise: Meeting Room Capacity Check **Objective:** Write a program that determines whether a meeting room is in violation of fire law regulations regarding the maximum room capacity. **Instructions:** 1. **Input Requirements:** - The program should read the **maximum room capacity**. - The program should read the **number of people** attending the meeting. 2. **Program Logic:** - If the number of people is **less than or equal to** the maximum room capacity: - The program should announce that it is legal to hold the meeting. - Inform how many additional people may legally attend. - If the number of people **exceeds** the maximum room capacity: - The program should announce that the meeting **cannot be held** as planned due to fire regulations. - Inform how many people must be excluded to meet the fire regulations. 3. **Advanced Version:** - For a more challenging task, modify your program to allow the calculation to be repeated as often as the user wishes. - If this is a class exercise, consult your instructor to determine whether to attempt this version. --- **Example Pseudocode:** ``` pseudocode BEGIN READ max_capacity READ num_people IF num_people <= max_capacity THEN PRINT "It is legal to hold the meeting." PRINT "Additional people that may legally attend: ", max_capacity - num_people ELSE PRINT "The meeting cannot be held due to fire regulations." PRINT "Number of people to exclude: ", num_people - max_capacity ENDIF PRINT "Do you want to perform another calculation? (yes/no)" READ user_response IF user_response == "yes" THEN REPEAT the above steps ELSE EXIT ENDIF END ``` Use this pseudocode as a guide to implement the solution in your preferred programming language. This task will help reinforce concepts related to conditional statements and user input handling.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Operators
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education