Question: Your assignment's C file name will be Code 6 _ xxxxxxxxxx . c where xxxxxxxxxx is your student id . I will refer to this
Your assignment's C file name will be Codexxxxxxxxxxc where xxxxxxxxxx is your student id I will refer to this file
in the rest of this document as Codec
You are creating a program that will sell tickets to seats in a movie theater. You will set up the theater by asking how big the
theater is row and seats per row You will then ask how many tickets are needed. You will then allow the user to pick seats
in your theater. You will determine if the chosen seat is available or already sold. If the seat is already sold, then the user will
be prompted to pick a different seat. If the seat is available, then the seat will be sold.
Please watch the videos showing how the program is run before reading the rest of this document. Look over the
Codetemplate.c file also before continuing.
Create three #defines at the top of the program. They should all be listed together so that the GTA may easily find
them and change them for testing. Please use the EXACT words.
MAXROWS set to
MAXCOLS set to
TICKETLIMIT set to
main
Create a char D array named MovieTheater of size MAXROWS by MAXCOLS
Prompt the user for how big the movie theater is Ask for the number of rows and the seats per row. The user input
for number of rows should not be allowed to exceed MAXROWS and the user input for number of columns should not
be allowed to exceed MAXCOLS. Prompt the user to enter values until both values are in range. Any messages
referring to those maximums should use the #define values.
Call function FillMovieTheater to initialize the array to Oletter O not zero Pass in the number of rows
and seats per row entered by the user. Pass in the ENTIRE array but only INITIALZE the part that matches the number
of rows and columns entered by the user.
Prompt the user for how many tickets to purchase. If user enters then don't proceed. The user should only be
allowed to buy a maximum number of tickets TICKETLIMIT The user input should not be allowed to exceed
that limit Prompt the user for number of tickets until the entered value is in range not less than and not greater
than TICKETLIMIT Any messages referring to that limit should use the #define value.
While not all tickets have been sold
Call PrintSeatMap see screenshots for format and required output
Prompt the user for a seat choice
Translate the seat choice A C etc to an array row and array column value. For example, A is array row
and array column
If the seat is not inside the theater, print message.
Else you have a valid seat choice if the seat has been sold call function IsSeatSold
Else increment the number of tickets sold because ticket was valid and had not been sold
FillMovieTheater
Return type void
Parameters D array of seat map, rows, seats
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
