Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q1. A movie theater only keeps a percentage of the revenue earned from ticket sales. The remainder goes to the movie distributor Write a program
Q1. A movie theater only keeps a percentage of the revenue earned from ticket sales. The remainder goes to the movie distributor Write a program that calculates a theater's gross and net box office profit for a night. The program should ask for the name of the movie, and how many adult and child tickets were sold. (The price of an adult ticket $6.00, child ticket is $3.00.) Assume the theater keeps 20% of the gross box office profit. Use cout statements to prompt the user for the name of the movie, number of child tickets sold and number of adult tickets sold. For the movie name use string datatype and use the getline feature to read in embedded space Example: string movieName /declare a variable of string datatype NOTE: if movie name is one word, like "Titanic" - then just write cin>>movieName; should work fine BUT if the name is more than one word like "Harry Potter", you will have trouble reading your program input. Instead, use getline( cin, movieName) Check Program 3-19 from the Text book for string input Note: string is NOT a built in datatype unlike int, double, and char, so you do need to add the string library header file #include etine() function s defined in string headee strine Declare the price of adult ticket and child ticket to be const double. const double ADULT TICKET 6.00;//constant declared and initialized const double CHILD_TICKET 3.00; Make sure that all constant declared identifiers are written as uppercase - its a programming norm (Note: the use of uppercase in ADULT_TICKET and CHILD_TICKET)
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