1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
arsen [322]
3 years ago
12

You need to control the number of people who can be in an oyster bar at the same time. Groups of people can always leave the bar

, but a group cannot enter the bar if they would make the number of people in the bar exceed the maximum of 100 occupants. Write a program that reads the sizes of the groups that arrive or depart. Use negative numbers for departures. After each input, display the current number of occupants. As soon as the bar holds the maximum number of people, report that the bar is full and exit the program.
Computers and Technology
1 answer:
Andru [333]3 years ago
4 0

Answer:

count = 0

while True:

   people = int(input("Enter the number of people arrived/departed: "))

   count += people

   

   if count == 100:

       print("The bar is full")

       break

   elif count < 100:

       print("There are " + str(count) + " in the bar currently")

   else:

       print(str(people) + " people cannot enter right now")

       print("The maximum capacity is 100!")

       count -= people

       print("There are " + str(count) + " in the bar currently")

Explanation:

*The code is in Python.

Set the count as 0

Create an indefinite while loop.

Inside the loop:

Ask the user to enter the number of people arrived/departed

Add the people to the count (cumulative sum)

Check the count. If the count is 100, stop the loop. If the count is smaller than 100, print the current number of people. Otherwise, state that they cannot enter right now. The capacity is 100 at most. Subtract the people from the count and print the current number of people.

You might be interested in
A telephone-repair technician uses a meter to measure voltage on a phone line. This meter is an example of _____. hardware softw
andrew-mc [135]
A meter to measure voltage would be an example of hardware.
5 0
3 years ago
Read 2 more answers
.
yan [13]

The correct answer is a paper bag

7 0
4 years ago
How to add bullet points in google slides??
Anettt [7]
<span>Open a document or presentation.Add or select a text box.<span>On the toolbar, click Bulleted list  or Numbered list .<span>Note: If you don't see the option, click More.</span></span>To change the style of the bullets or numbers, click the dropdown arrow next to the icons in the toolbar</span>
6 0
4 years ago
Read 2 more answers
What seems to be the prevailing opinion about enterprise clouds?
garik1379 [7]
Used by almost everyone
3 0
3 years ago
Read 2 more answers
Susan's monthly goal to open five new customer
SSSSS [86.1K]

Answer:

2. Measurable Goal

Explanation:

If she works hard, she can open 5 more customer accounts in time. I tried my best to answer this question, hope it helps!

4 0
3 years ago
Other questions:
  • A company has decided to re-introduce a retro-radio by reproducing a product that was manufactured in the 1940s. The company has
    5·1 answer
  • Who gave a demonstration of modern computer systems showing a mouse and when?
    8·1 answer
  • The amount you pay your insurer for your insurance plan is which of the following?
    14·1 answer
  • Who Can Infiltrate And Use Email Notifications To Camouflage Malicious Links ?
    13·1 answer
  • The purpose of a software design is to enable programmers to implement the requirements by designating the projected parts of th
    14·1 answer
  • Anyone wanna play Bloons tower defense 5 im rank 52
    5·2 answers
  • Saujani describes that women are highly underrepresented in STEM careersShe attributes this to women needing more confidence. Wh
    13·1 answer
  • c) If you are at foreign country visit, which banking card would you prefer to keep with you during visit (Debit Card or Credit
    10·1 answer
  • What are the fundamental activities that are common to all software processes?
    9·1 answer
  • If I bought mine craft p.e. for 7.99 and hook my Micro soft account up, will i get java edition
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!