only thing I need is a pseudocode for this assigments explai

only thing I need is a pseudocode for this assigments explaining how it will work. Need to be written out in words step by step on what has to be done to reach the objective.

Objectives: Create a Java program using programming fundamentals (file I/O, loops, conditional statements,

arrays, functions)

Problem: In preparation for the release of Guardians of the Galaxy 2, you have been hired by the owner of a small movie theater to develop the backend for an online ticket reservation system. Patrons will be able to reserve seats in one of three auditoriums. Once the patron has selected an auditorium, 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.

Details

The seating arrangement for each auditorium will be stored in separate files. These files will be named A1.txt, A2.txt and A3.txt for auditorium 1, 2 and 3 respectively.

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

The number of seats in each row of a single auditorium will be the same. For example, if the first line of the file has 15 seats, then every subsequent row in the theater will also have 15 seats. This does not mean that each auditorium has the same number of seats in each row. One auditorium may have 15 seats per row and another may have 20 seats.

Each auditorium will be held in a two-dimensional array.

Empty seats are represented by a pound sign (#).

Reserved seats are represented by a period (.).

Tickets can only be reserved the day of the screening and all screenings are at 7 PM that night. There is

no need to worry about multiple screenings or reserving seats on a specific day.

All tickets are $7 regardless of patron age or auditorium.

User Interface and Input: Present a user-friendly menu system for the user to select the auditorium. First ask for the auditorium:

Although in reality the user would likely only make one purchase, for testing purposes, assume the user will repeat the ticket buying process until they decide to quit.

Once the auditorium has been selected, 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.

The seats are numbered sequentially from left to right and only the ones digit is displayed above each column to make it easier to display the chart. It is understood that the second set of digits from 1-0 are for the numbers 11- 20 in the above example.

After the user has selected the auditorium and the seating chart has been displayed, prompt the user for the following information in the order below:

Row number

Starting seat number

Number of tickets

Assume that the user wants to reserve sequential seats to the right of the first seat entered.

If the desired seats are not available, offer the user 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. Prompt the user to enter aY to reserve the best available or N to refuse the best available. Once the selection has been processed, return to the main menu.

All input will be of the valid data type. You do not have to worry about the user entering a letter when a number is expected or a floating point number when an integer is expected. You are responsible for validating that the data falls within the proper range and that a user does not try to reserve a seat that is already reserved.

Output: At the end of the program, write the current status of each auditorium to the respective file. Also, display a formatted report to the console. The report should consist of 4 columns:

Column 1 – labels
o Auditorium 1

o Auditorium 2

o Auditorium 3

o Total

Column 2 - number of seats reserved for each label

Column 3 - the number of open seats for each label

Column 4 - the total of the ticket sales for each label

Solution

The problem is very clear that you have to deal with the file operations.

For this you must have knowledge on File I/O classes- File, FileReader, FileWriter, BufferedWriter & BufferedReader .

The psueocode in words for your assignment is as follows:

step 1: create a class with a main method: public static void main(String args[])

step 2: Load three files with different number of columns & rows in each file with # indicates empty seat

A1.txt A2.txt A3.txt - text files.

step 3: create 3 two dimensional arrays- one dimensional array indicates one auditorium seats

step 4: Now with the help of while loop and if - else or switch statements, Prompt the user to select audiorium out of three auditoriums, and an exit option to exit the program / selection.

step 5: now you have to code within the while loop for the other operations for each indivudual selected option.

step 6: quit if user selects exit option.

step 7: operations are similar for auditorium 1, 2 and 3. determine the option selected by user.

step 8: Assume if user selects option 1 then, Go for the file A1.txt. to retrive the data (#s & .s) from file. using respective file reader and bufferedreader classes.

step 9: determine the number of rows and columns after retreiving the data from file.

step 10: Now declare and initialize array size according the rows and columns. from the data.

step 11: Now promt the user to select seat to book. as

row number

seat number (starting)

number of tickets

step 12: check with array weather it has # or . at that positions. if it has # replace array element with . indicating tickets are booked.

step 13: otherwise give other seats in the same row near by (seat column numbers diff should be lesser)

step 14: now promt the user to book these suggested seats Y or N

step 15: now if user enters Y. go ahead replace # with . else repeat the seat selection steps again

step 16: Now you have to update the file auditorium - A1.txt in our case.

step 17: Note: you cannot update file in middle. To update file create a new file ex. temp.txt now update array data into file then delete old file A1.txt , now rename temp to A1.txt

step 18: Do these steps same for Auditorium 2 and Auditorium 3.

step 19: Now with the help of our array data we can determine how many seats are booked and how many are not for each auditorium.

step 20: Using the for loops calcuate the sum 7- for each seat.

step 21: take out these values in an array to present on the conslole.

step 22: finish.

only thing I need is a pseudocode for this assigments explaining how it will work. Need to be written out in words step by step on what has to be done to reach
only thing I need is a pseudocode for this assigments explaining how it will work. Need to be written out in words step by step on what has to be done to reach
only thing I need is a pseudocode for this assigments explaining how it will work. Need to be written out in words step by step on what has to be done to reach

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site