Question no 1:
Your program should display a list of available movies along with their corresponding codes so that a user can select a movie by entering its code. For example, if the user selects code 1, it means "Inception", 2 means "Interstellar", and so on. If the user enters an invalid code, the program should display an error message and terminate.
After selecting a movie, the program should prompt the user to enter the number of tickets they want to purchase. The number of tickets must be greater than 0. If the user enters an invalid number (e.g., 0 or a negative value), the program should display an error message and terminate.
EXAMPLE OUTPUT:
Available Movies:
1. Inception
2. Interstellar
3. The Dark Knight
4. Avengers: Endgame
----------------------------------
Enter movie code: 2
Enter number of tickets: 3
Booking confirmed! You have booked 3 tickets for Interstellar.
----------------------------------
INVALID INPUT EXAMPLE:
Enter movie code: 5
Invalid movie code! Please try again.
Enter movie code: 1
Enter number of tickets: 0
Invalid ticket quantity! Please enter a value greater than 0.
QUESTION NO 2:
Write a program to calculate and print a list of all prime numbers from 1 to 100. QUESTION NO 3:
Write a program that prints the sum, the sum of the squares, and the sum of the cubes of all natural numbers from 1 till any number entered by the user

0 Comments