Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
0 views

algorithm

The algorithm outlines a program for managing a movie booking system, including options to view movies, book or cancel tickets, and order food. It involves user input for various choices, validating seat availability, and calculating total food costs. The program continues to loop until the user decides to exit, ensuring a user-friendly experience.

Uploaded by

shravandhekale8
Copyright
© © All Rights Reserved
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

algorithm

The algorithm outlines a program for managing a movie booking system, including options to view movies, book or cancel tickets, and order food. It involves user input for various choices, validating seat availability, and calculating total food costs. The program continues to loop until the user decides to exit, ensuring a user-friendly experience.

Uploaded by

shravandhekale8
Copyright
© © All Rights Reserved
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 2

ALGORITHM :-

STEP 1 - Start

STEP 2 - Initialize necessary variables (movies, seats, foodItems, foodPrices) and set up a loop to
continue the program as long as the user wants.

STEP 3 - Display the main menu options (View Movies, Book Tickets, Cancel Tickets, Order Food, Exit)
and get user input for the choice.

STEP 4 - If choice is 1, call the function to display available movies.

STEP 5 - If choice is 2, perform the following:

· Call the function to display available movies.

· Get user input for the movie choice .

· Call the function to display available seats.

· Get user input for the number of seats to book .

· For each seat to be booked:

· Get user input for the row (A or B) and seat number (1-10).

· Validate the row and seat number.

· If the seat is available, mark it as booked and display a success message.

· If the seat is already booked, display an error message.

STEP 6 - If choice is 3, perform the following:

· Get user input for the row (A or B) and seat number (1-10) to cancel.

· Validate the row and seat number.

· If the seat is booked, mark it as available and display a cancellation success message.

· If the seat is not booked, display an error message.

STEP 7 - If choice is 4, perform the following:

· Display available food items and their prices.

· Get user input for the number of food items to order (numItems).

· For each food item to be ordered:


· Get user input for the food item number.

· Validate the food choice.

· Get user input for the seat number (e.g., A1, B5).

· Add the food item's price to the total cost and display a confirmation message.

· Display the total food cost and payment instructions.

STEP 8 - If choice is 5, display a thank you message and exit the program.

STEP 9 - If choice is invalid, display an error message and repeat the menu.

STEP 10 - Repeat the process until the user selects the exit option (choice == 5).

STEP 11 - Terminate the program.

You might also like