Question: please i need it soonn We need a program that will calculate the price of cinema tickets. To write the program, please follow the questions
We need a program that will calculate the price of cinema tickets. To write the program, please follow the questions 1 to 3. Note that the price of 1 ticket is given according to the row number in the following table: 1 to 5 Row Price of 1 ticket 6 to 10 20 >10 15 30 1 1. Write a method that will accept a char representing the type of the ticket (s or S for student and m or M for military) and return the discount percentage. The discount percentage is 20% for students and 50% for military and 0 otherwise. 2- Write a method call calculate Total that will accept the number of tickets, the row code and the discount rate and return the total to be paid. Total= number of tickets *price of 1 ticket * (1-discount) 3- Write a driver program that will ask the user to enter a char representing type of the ticket, the row number and an integer representing the number of tickets and display the total to be paid for those tickets. Sample run1 Enter the type of your ticket (s for student, m for military, or any other letter for normal ticket): s Enter the row number: 6 Enter the number of tickets: 1 The total to be paid is: 16$ Sample run2 Enter the type of your ticket (s for student, m for military, or any other letter for normal ticket): g Enter the row number: 3 Enter the number of tickets: 2 The total to be paid is: 60$
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
