Question

In: Computer Science

Le Chef Heureux Restaurant has 20 tables that can be reserved at 5 p.m., 7 p.m.,...

Le Chef Heureux Restaurant has 20 tables that can be reserved at 5 p.m., 7 p.m., or 9 p.m. Design a program that accepts reservations for specific tables at specific times; the user enters the number of customers, the table number, and the time. Do not allow more than four guests per table or invalid table numbers or times. If an attempt is made to reserve a table already taken, reprompt the user. Continue to accept reservations until the user enters a sentinel value or all slots are filled. Then display all empty tables in each time slot.

create a solution algorithm using pseudocode

create a flowchart

Solutions

Expert Solution

Solution Algorithm:

create 2 D list , each row will represent 1 table and each
table will have 3 columns representing the times - 5pm 7pm and 9pm

booking_slots from range 0 to 20

while True:
    customers = int(input('Enter the number of customers (0 to exit): '))
    if customers greater than 4:
        print('Only 4 customers are allowed per table.')
        continue
    elif customers == 0:
        break
    else:
        table_number = int(input('Enter table # (1-20): '))
        if 1 less than table_number and table_number <= 20:
            time equals int(input('[1]-5pm [2]-7pm [3]-9pm Enter 1-3: '))
            if 1 less than or equal to time and time <= 3:
                if booking_slots[table_number - 1][time - 1] == 0:
                    booking_slots[table_number - 1][time - 1] = customers
                    print('Table reserved!')
                else:
                    print('Table already booked. Table not available at this time.')
            else:
                print('Sorry! You entered an invalid table #.')
                continue
        else:
            print('Sorry! You entered an invalid table #.')
            continue
print('Empty Tables')
for table in range(20):
    for i in range(3):
        if booking_slots[table][i] == 0 and i == 0:
            print('Table# {} at 5p.m available'.format(table + 1))
        elif booking_slots[table][i] == 0 and i == 1:
            print('Table# {} at 7p.m available'.format(table + 1))
        elif booking_slots[table][i] == 0 and i == 2:
            print('Table# {} at 9p.m available'.format(table + 1))
Let me know if you have any doubts or if you need anything to change. 

If you are satisfied with the solution, please leave a +ve feedback : ) Let me know for any help with any other questions.

Thank You!
===========================================================================

Related Solutions

JAVA: Le Chef Heureux Restaurant has 20 tables that can be reserved at 5 p.m., 7...
JAVA: Le Chef Heureux Restaurant has 20 tables that can be reserved at 5 p.m., 7 p.m., or 9 p.m. Design a JAVA program that accepts reservations for specific tables at specific times; the user enters the number of customers, the table number, and the time. Do not allow more than four guests per table or invalid table numbers or times. If an attempt is made to reserve a table already taken, re-prompt the user. Continue to accept reservations until...
DESIGN IN RAPTOR PROGRAMMING APP Le Chef Heureux Restaurant has 20 tables that can be reserved...
DESIGN IN RAPTOR PROGRAMMING APP Le Chef Heureux Restaurant has 20 tables that can be reserved at 5 p.m., 7 p.m., or 9 p.m. Design a program that accepts reservations for specific tables at specific times; the user enters the number of customers, the table number, and the time. Do not allow more than four guests per table or invalid table numbers or times. If an attempt is made to reserve a table already taken, reprompt the user. Continue to...
restaurant has 5 tables available. People arrive at times of a Poisson process with rate of...
restaurant has 5 tables available. People arrive at times of a Poisson process with rate of 6 per hour. The amount of time for a person to eat has an exponential distribution with a mean of 30 minutes. People who arrive when all 5 tables are full turn around and leave without eating at the restaurant. In the long run, what fraction of time is the restaurant full?
The patio of a restaurant has three tables at which two, four, and five patrons can...
The patio of a restaurant has three tables at which two, four, and five patrons can be seated, respectively. A party of eleven is to be seated on the patio. (a) In how many ways can the party of eleven be seated at the three tables (it is not important in which seats at each table the patrons sit). (b) Three friends among the party wish to sit together. In how many ways can the party of eleven be seated...
Restaurant Pricing. Consider a restaurant that charges $10 for all, you can eat and has 20...
Restaurant Pricing. Consider a restaurant that charges $10 for all, you can eat and has 20 customers at this price. The slope of the demand curve is minus−​$0.20 per​ meal and the marginal cost of providing a meal is ​$66. ​1.) Use the line drawing tool to draw and label the demand line. ​2.) Use the line drawing tool to draw and label the marginal revenue line. ​3.) Use the line drawing tool to draw the marginal cost line. Carefully...
Gina has been head chef at a local Italian restaurant for the last 15 years. She...
Gina has been head chef at a local Italian restaurant for the last 15 years. She is from a large Italian family that loves not only cooking but also eating. Although Gina has grown up around large amounts of food and hearty appetites, she has learned to control her weight and eat moderately. However, Gina's husband, Anthony, has difficulty moderating his eating habits. They have been married for three years, and in that time Anthony has put on 20 kg,...
The owner of an exclusive restaurant has two tables but only one waiter. If the second...
The owner of an exclusive restaurant has two tables but only one waiter. If the second table is occupied, the owner waits on that table himself. Service times are exponentially distributed with mean 1 hour, and the time between arrivals is exponentially distributed with mean 1.5 hours. When the restaurant is full, people must wait outside in line. a) What percentage of the time is the owner waiting on a table? b) If the owner wants to spend at most...
Business Law Question Alina, a chef who has never owned her own restaurant, sues a builder...
Business Law Question Alina, a chef who has never owned her own restaurant, sues a builder who failed to finish building her first restaurant on time. She presents evidence of the profits made by similar restaurants that have been in business for some time. Is this good evidence of the damages she has suffered because of the delay? To what damages is she entitled?
Task 7 - Memory (5 +5 + 5 +5 = 20 marks) Please explain in your...
Task 7 - Memory (5 +5 + 5 +5 = 20 marks) Please explain in your own words for each part of Question 7. Quote your references in your ―References‖ / ―Bibliography‖ (a) What does INTEL‘s ―Optane Memory‖ provide? (b) What are some of the claims made by the ―Intel Marketing Department regarding Optane Memory. DDR5 memory is the latest computer memory being developed and will eventually replace DDR4 memory. (c) What are the maximum clocks speeds for DDR4 memory,...
1. Create an ERD that has at least 5 tables in it and include all of...
1. Create an ERD that has at least 5 tables in it and include all of the details and the correct notation (Min/Max cardinality and relationship name.) 2. Write a paragraph that explains the ERD. 3. Write the SQL Create, Insert, and Update statement to insert one of the entities from this ERD into a database.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT