Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A movie theater only keeps a percentage of the revenue earnedfrom ticket sales.

ID: 3541421 • Letter: A

Question

A movie theater only keeps a percentage of the revenue earnedfrom ticket sales. The remainder goes to the distributor. Write aprogram that calculates a theater's gross and net box office profitfor a night. The program should ask for the name of the movie, andhow manhy adult and child tickets were sold. (The price of an adultticket is $6.00 and a child's ticket is $3.00.) It should display a report similar to the following:

MovieName:                         Wheels of Fury
Adult TicketsSold:                   382
Child TicketsSold:                   127
Gross Box OfficeProfit:             $ 2673.00
Amount Paid toDistributor:       $2138.40
Net Box OfficeProfit:                 $  534.60

Assume the theater keeps 20 percent of the gross boxoffice profit.

Must use the setprecision option.




i have this but im not sure if this works.


Explanation / Answer

#include <iostream> #include <iomanip>
using namespace std;
int main () { // variables float adult; float child; float gross; float net; float child_price = 3.00; float adult_price = 6.00; float cut; float cut_amt = (20/100); char movieName; char noAdult; char noChild;
// assign data
cout << "Enter name of movie" << endl; movieName = cin.get (); cin.ignore ();
cout << "Enter how many adult tickets were sold" << endl; noAdult = cin.get (); cin.ignore ();
cout << "Enter how many child tickets were sold" << endl; noChild = cin.get();
//calculation adult = noAdult * adult_price; child = noChild * child_price; gross = adult + child; cut = gross * cut_amt; net = gross - cut;
//display cout << "Movie Name;" << setw (10) << movieName << endl;
cout << "Adult Tickets Sold:" << setw (10) << noAdult << endl;
cout << "Child Tickets Sold:" << setw (10) << noChild << endl;
cout << "Gross Box Office Profit: $" << setw (10) << gross << endl;
cout << "Net Box Office Profit: $" << setw (10) << net << endl;
cout << "Amount Paid to Distributor: $" << setw (10) <<cut << endl; return 0;
} #include <iostream> #include <iomanip>
using namespace std;
int main () { // variables float adult; float child; float gross; float net; float child_price = 3.00; float adult_price = 6.00; float cut; float cut_amt = (20/100); char movieName; char noAdult; char noChild;
// assign data
cout << "Enter name of movie" << endl; movieName = cin.get (); cin.ignore ();
cout << "Enter how many adult tickets were sold" << endl; noAdult = cin.get (); cin.ignore ();
cout << "Enter how many child tickets were sold" << endl; noChild = cin.get();
//calculation adult = noAdult * adult_price; child = noChild * child_price; gross = adult + child; cut = gross * cut_amt; net = gross - cut;
//display cout << "Movie Name;" << setw (10) << movieName << endl;
cout << "Adult Tickets Sold:" << setw (10) << noAdult << endl;
cout << "Child Tickets Sold:" << setw (10) << noChild << endl;
cout << "Gross Box Office Profit: $" << setw (10) << gross << endl;
cout << "Net Box Office Profit: $" << setw (10) << net << endl;
cout << "Amount Paid to Distributor: $" << setw (10) <<cut << endl; return 0;
}
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote