Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Python 3+ Do the following problem, Please put comments inside the code. Make sure you check for the row-number and column number for an

Using Python 3+ Do the following problem, Please put comments inside the code.

Make sure you check for the row-number and column number for an integer between 1 and 5.

(See next page)

The New Star Theater has 25 seats, which are set up as 5 rows and 5 columns. The price for each seat is based on the row and column show below.

Columns

1 2 3 4 5

1 50 50 50 50 50

2 40 45 45 45 40

Rows 3 30 35 35 35 30

4 20 20 20 20 20

5 10 10 10 10 10

Fill a 5 x 5 grid. Then do the following.

Create a loop that will continue until the user says (Y/N) they want to quit, or all 25 seats are sold. Have the users ask for a seat position based on row and column (row, column) - remember that the lists positions start at 0, but the user will ask for the seat starting at row or column position 1. Then when the user selects the seat, print out the user's price and mark an 'SS' (sold seat) in the List where the price was. Then print out all the seats so the user can select another. When the next user in the loop, asks for a seat make sure you check and see if that seat is already sold (has an SS in the table). If it is sold, tell the user otherwise return the price and mark the seat sold. After the user asks to quit or all the seats are sold, or the loop ends, then printout the list as shown below - showing the sold seats (SS) and unsold seats (the unsold seat should still have a price).

Print out the array (as a two-dimensional matrix) showing which seats were sold, and which seats have not been sold.

For example, it might look like this:

50 50 SS SS 50

40 45 SS SS 40

30 35 25 35 30

SS 20 20 20 20

10 10 10 10 10

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

DB2 9 For Linux UNIX And Windows Advanced Database Administration Certification Certification Study Guide

Authors: Roger E. Sanders, Dwaine R Snow

1st Edition

1583470808, 978-1583470800

More Books

Students also viewed these Databases questions