Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a C + + program that calculates and returns a movie ticket price depending on the seat. The program will have the following functions:
Create a C program that calculates and returns a movie ticket price depending on the seat. The program will have the following functions:
One function seatcategory to collect the ticket seats. The function asks the user to enter a seat p or P o or O and return the character. p is for premium seat and o for orchestra seat. If the user enters a different character, the program will ask the user to enter a valid character.The function only returns a valid character, p or P f or F
A function to collect and return the number of tickets. A user can only purchase between and tickets. Any other amount of tickets will not be valid and the function will ask the user to enter another amount of tickets.
One function total to calculate and return the total ticket price. The total ticket price is calculated as:
Premium seat Orchestra seat
Ticket fee $ per ticket
Transaction fee $
Total ticket price ticket fee transaction fee
Ticket fee $ per ticket
Transaction fee $
Total ticket price ticket fee transaction fee
one function to prompt the result as
TOTAL TICKET PRICE
Seat category
Number of tickets
Total ticket price $
The main function should be as:
int main
char seat seatcategory;
int numtickets ticketnum;
float totalprice totalstatus numcredit;
promptresultseat numtickets, totalprice;
return ;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started