You are on page 1of 2

Chinenyenwa Muoneke

CXM190008
March 7 2020

Project 3 Pseudocode

Structure
Row (integer)
Seat (character)
Ticket type (character)
Up (Node pointer)
Down (Node pointer)
Left (Node pointer)
Right (Node pointer)
(1) int function to count total seats, pass in linked list
Return total seats
(2) int function to display seats and, pass in linked list and total seats
Return columns
(3) void function to get user input, pass in linked list and columns
Ask what and how many tickets the user want to reserve
Call function 4
If (4) is points to a node call function 5
Else call function 6
If (5) points to node call function 5 and ask if user want to reserve tickets
(4) void function to check if seat is available, pass in linked list and # of tickets
Put linked list in a loop to find first seat then check if seats are available
get new pointer to point at first seat
Return node if seats found else return null (will that work?)
(5) void function to reserve tickets, pass in new pointer, # of tickets(for each category) and linked list
Reserve adult ticket first then child then senior
(6) void function to reserve best available seats, pass in linked list, columns and # of tickets
Find the middle row and middle letter and put a new pointer pointing to it
Use nested for loop to sort through linked list
Increase area loop searches through and move new pointer
If seats are found return node new pointer points to else return null
Chinenyenwa Muoneke
CXM190008
March 7 2020

(7) void function to print out report to copied file


(0) Main
Ask user for file
Copy input from file to new file and linked list
Link left and right pointers first then go back and link up and down pointers
While loop
Call function 1 and 2
Call function 3
End loop
If user exit loop call function 7

You might also like