Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is in PYTHON! Write a program that prompts user to pick either a seat or a price. ( table size is 5 X 5

This is in PYTHON!

Write a program that prompts user to pick either a seat or a price. (table size is 5 X 5)

 price_chart = [[10, 10, 10, 10, 10], [20, 20, 20, 10, 10], [20, 20, 20, 10, 10], [20, 20, 20, 10, 10], [40, 30, 30, 20, 20]] 
 Pick a (S)eat or a (P)rice or (Q)uit? 

When the user pick a "S", then ask:

 Enter the row: Enter the column: 

When the user specifies a seat, make sure it is available and display :

 Sold, for $xx 

Where xx is the price of the chosen seat. Mark sold seats by changing the price to 0.

If another user pick the same seat, then display:

 Sorry, that seat is not available. 

When the user specifies a price, ask

 How much do you want to spend? 

Find any seat with that price, then display:

 You can have seat x x 

Where xx is the row and column of the seat. If the tickets are not found with that price, display:

 Sorry, there are no tickets available at that price. 

If the user enters other than S, P, Q then display:

 That wasn't a valid option.

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

Modern Database Management

Authors: Fred R. McFadden, Jeffrey Slater, Mary B. Prescott

5th Edition

0805360549, 978-0805360547

More Books

Students also viewed these Databases questions