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")
Step-by-step 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.