Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Imagine that you are creating a ticket reservation system. A section is rectangular ( each row has the same number of seats ) There are
Imagine that you are creating a ticket reservation system. A section is rectangular each row has the same number of seats There are multiple rows. An example might be seats in a row and there are rows. It can be larger if you want but not smaller.
You want the operator user to be able to put in the number of seats, and then the seats best possible seats will be assigned. Make sure to give clear prompts to the user so they know what to enter.
Assume that the party wants to sit consecutively in the same row. Assume random groups of
Try to assign the seats as efficiently as possible, minimizing gaps.
Provide some output to your user. An acknowledgement of where the seats are or you can print out your seat map, or both.
Example: You have been issued seats in row
some Steps complete
Array x
Get party number
Variable for each row seat number then deduct.
If party was greater than available seats then full.
Cancel rows when they are full.
If you run out of seats, ask if you want to flow into next row.
If they dont want to move them to the next row.
Loop through each row.
Boolean and to indicate occupied seat.
Can you help write one example programing for look based the required above but write simple for college student and just use arrays and give some guidance done
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started