Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in c++ CS111 Lab#3 Due: March 5th Q1. A movie theater only keeps a percentage of the revenue earned from ticket sales. The remainder goes

image text in transcribed

image text in transcribed

in c++

CS111 Lab#3 Due: March 5th 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 getive 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 gin >2 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 getlinel sin, 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 getline U function is defined in string header file cstring 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) Use setprecision for formatting a decimal number (two places after), See example code below: cout So write #include

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

Step: 3

blur-text-image

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

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions