// Nicolas Ruano CS1A Chapter 3 Pp.143-144 #5
/*******************************************************************************
* BOX OFFICE SOLVING
* ____________________________________________________________________________
* In this program, we are trying to figure out and understand how many tickets
* and the box office of the film. Piece by piece, it is broken down in
* sequencial steps for solving the probllem
* ____________________________________________________________________________
* INPUT of what we have so far
* The Price of Adult Tickets (adultTickets) = 6.00
* The price of Child Tickets (childTickets) = 3.00
* The theater percent = 0.20 -> which is 20%
*
* The number of Adult Tickets being sold = 382
* The number of Child Tickets being sold = 127
* ____________________________________________________________________________
* OUTPUT for displaying
* Name of the film: Wheels of Fury
* Adult Tickets sold = 382
* Child Tickets sold = 127
* The gross Box Office profit = $2673.00
* Net Box Office Profit = $534.00
* Amount Paid to Distributor: $2138.40
*******************************************************************************/
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
int main() {
const double ADULT_TICKET_PRICE = 6.00;
const double CHILD_TICKET_PRICE = 3.00;
const double THEATER_PERCENT = 0.20; // 20% goes to theater
string movieName;
int adultTickets, childTickets;
double grossProfit, netProfit, distributorAmount;
// Input
cout << "Enter the name of the movie: Wheels of Fury\n";
getline(cin, movieName); // Use getline for movie names with spaces
cout << "Enter the number of adult tickets sold: 382\n";
cin >> adultTickets;
cout << "Enter the number of child tickets sold: 127\n";
cin >> childTickets;
// Calculations
grossProfit = (adultTickets * ADULT_TICKET_PRICE) + (childTickets * CHILD_TICKET_PRICE);
netProfit = grossProfit * THEATER_PERCENT;
distributorAmount = grossProfit - netProfit;
// Output formatted report
cout << fixed << setprecision(2);
cout << "\nMovie Name: Wheels of Fury" << movieName << endl;
cout << "Adult Tickets Sold: 382" << adultTickets << endl;
cout << "Child Tickets Sold: 127" << childTickets << endl;
cout << "Gross Box Office Profit: $2673.00" << grossProfit << endl;
cout << "Net Box Office Profit: $534.60" << netProfit << endl;
cout << "Amount Paid to Distributor: $2138.40" << distributorAmount << endl;
return 0;
}