//Devin Scheu CS1A Chapter 3, P. 143, #5
//
/**************************************************************
*
* CALCULATE BOX OFFICE PROFIT
* ____________________________________________________________
* This program calculates the gross and net box office profit
* for a movie theater based on adult and child ticket sales.
* The theater keeps 20% of the gross profit, and the rest goes
* to the distributor.
*
* Computation is based on the formulas:
* grossProfit = (adultTickets * 6.00) + (childTickets * 3.00)
* netProfit = grossProfit * 0.20
* distributorProfit = grossProfit - netProfit
* ____________________________________________________________
* INPUT
* movieName : Name of the movie (as a string)
* adultTickets : Number of adult tickets sold (as an integer)
* childTickets : Number of child tickets sold (as an integer)
*
* PROCESSING
* grossProfit : Total revenue from ticket sales (in dollars)
* distributorProfit : Amount paid to the movie distributor (in dollars)
*
* OUTPUT
* netProfit : Theater's profit after distributor's share (in dollars)
*
**************************************************************/
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
int main () {
//Variable Declarations
string movieName; //INPUT - Name of the movie (as a string)
int adultTickets; //INPUT - Number of adult tickets sold (as an integer)
int childTickets; //INPUT - Number of child tickets sold (as an integer)
double grossProfit; //PROCESSING - Total revenue from ticket sales (in dollars)
double netProfit; //OUTPUT - Theater's profit after distributor's share (in dollars)
double distributorProfit; //PROCESSING - Amount paid to the movie distributor (in dollars)
//Prompt for Input
cout << "Enter the name of the movie: ";
getline(cin, movieName);
cout << "\nEnter the number of adult tickets sold: ";
cin >> adultTickets;
cout << "\nEnter the number of child tickets sold: ";
cin >> childTickets;
//Calculate Gross Profit
grossProfit = (adultTickets * 6.00) + (childTickets * 3.00);
//Calculate Net Profit and Distributor Profit
netProfit = grossProfit * 0.20; // 20% of gross profit
distributorProfit = grossProfit - netProfit;
//Output Result
cout << fixed << setprecision(2);
cout << "\n";
cout << left << setw(25) << "Movie Name:" << right << setw(15) << "\"" << movieName << "\"" << endl;
cout << left << setw(25) << "Adult Tickets Sold:" << " " << right << setw(12) << adultTickets << endl;
cout << left << setw(25) << "Child Tickets Sold:" << " " << right << setw(12) << childTickets << endl;
cout << left << setw(25) << "Gross Box Office Profit:" << right << setw(15) << "$ " << grossProfit << endl;
cout << left << setw(25) << "Net Box Office Profit:" << right << setw(15) << "$ " << netProfit << endl;
cout << left << setw(25) << "Amount Paid to Distributor:" << right << setw(15) << "$ " << distributorProfit << endl;
} //end of main()