Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone just give me the pseudocode for this program? Problem: In preparation for the release of Avengers this summer, you have been hired by

Can someone just give me the pseudocode for this program?

Problem: In preparation for the release of Avengers this summer, you have been hired by the owner of a very small movie theater to develop the backend for an online ticket reservation system. The program should display the current seating arrangement and allow the patron to select seats. A report should be generated at the end of the program to specify for each individual auditorium and overall for all auditoriums how many seats were sold/unsold and how much money was earned.

Pseudocode: Your pseudocode should describe the following items

Main.cpp

o List functions you plan to create

Determine the parameters

Determine the return type

Detail the step-by-step logic that the function will perform

o Detail the step-by-step logic of the main function

Details Use the template posted in ZyLabs.

o The code in the template prompts the user for a filename

o The file is then copied to a file named A1.txt This copy is necessary because ZyLabs will not allow the original file to be modified

o A1.txt is the file that will be modified for the entirety of the program

Each line in the file will represent a row in the auditorium. The number of rows in the auditorium is unknown to you.

o There will be a newline character after each line in the file except for the last line which may or may not have a newline character.

The number of seats in each row of the auditorium will be the same.

No row will have more than 26 seats.

Do not hold the auditorium in memory (-15 points if auditorium is held in memory)

o Utilize random file access to view and modify the auditorium

Empty seats are represented by a period (.).

Reserved seats are represented by a letter (A, C or S) in the file

o This will be used to create reports o A =adult o C = child o S = senior

Reserved seats will be represented by a hashtag (#) on the screen o The user does not need to know what type of ticket was sold, just that a seat is reserved.

There is no need to worry about reserving seats on a specific day or at a specific time.

Ticket prices are as follows: o Adult - $10 o Child - $5 o Senior - $7.50

User Interface and Input: Present a user-friendly menu system for the user.

1. Reserve Seats

2. Exit Loop the menu until the user decides to exit. Imagine this is for a ticket kiosk in the lobby of the theater. If the user wants to reserve seats, display the current seating availability for that auditorium. An example seating chart is provided below for an auditorium with 5 rows and 20 seats per row.

ABCDEFGHIJKLMNOPQRST

1 ...##..#####........

2 ########....####..##

3 .........##.........

4 #.#.#.#.#.#.#.#.#.#.

5 ########.#####.#####

Assume that the user wants to reserve sequential seats to the right of the first seat entered. All seats must be open for a reservation to be processed. Remember to mark the seat with the appropriate letter to show it has been reserved. Adult tickets will be reserved first, followed by child and then senior. If the selection is available, mark the seats as reserved and return to the main menu.

If the desired seats are not available, check for the best available seats that meet their criteria on that row only. The best available seats are the seats closest to the middle of the row measured by the distance from the center of the available selection to the middle of the row. If alternate seats are available, prompt the user to enter a Y to reserve the best available or N to refuse the best available. Once the selection has been processed, return to the main menu. If there are no alternate seats available, display an appropriate message to the user instead of a prompt and return to the main menu.

Display main menu Prompt for input

If user is reserving tickets o Prompt for row o Validate loop until valid

Valid row = row number listed in auditorium display

o Prompt for starting seat o Validate loop until valid

Valid seat = seat number listed in auditorium display

o Prompt for number of adult tickets o Validate loop until valid

Valid ticket number = number >= 0

o Prompt for number of child tickets o Validate loop until valid

Valid ticket number = number >= 0

o Prompt for number of senior tickets

o Validate loop until valid

Valid ticket number = number >= 0

o If seats unavailable

Display best available

Prompt user to reserve (Y/N)

o If reserved, confirm reservation

o Return to main menu

Loop to top of workflow until user selects exit

Output: Display the best available seats in the following format:

-

Example: 3D 3F

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

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions