Question: In Python write a program that prompts user to pick either a seat or a price. (table size is 5 X 5) chart = [[10,

In Python write a program that prompts user to pick either a seat or a price.

(table size is 5 X 5)

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 picks "S", 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 picks the same seat, then display:

Sorry, that seat is not available.

When the user picks 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, 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!