Answered step by step
Verified Expert Solution
Link Copied!

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 seat_category() 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 1 and 12 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= $12.50 per ticket
Transaction fee = $5.99
Total ticket price = ticket fee + transaction fee
Ticket fee= $19.50 per ticket
Transaction fee = $8.99
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 = seat_category();
int num_tickets = ticket_num();
float total_price = total(status, num_credit);
prompt_result(seat, num_tickets, total_price);
return 0;
}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions