Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <iomanip>
- using namespace std;
- int main ()
- {
- string movieName;
- int adultTickets, childTickets, childTicketsSold, adultTicketsSold;
- double grossProfit, amountPaid, netProfit;
- const double AMOUNT_PAID = .8;
- cout << "What was the name of the movie?";
- cin >> movieName;
- cout << "What was the total amount of adult tickets sold?\n";
- cin >> adultTickets;
- cout << "What was the total amount of child tickets sold?\n";
- cin >> childTickets;
- cout << left << setw(30) << "Movie Name" << right << setw(25) << movieName << endl;
- //Compute of Adult Ticket Income
- adultTicketsSold = adultTickets * 6;
- cout << left << setw(30) << "Adult Tickets Sold:" << right << setw(25) << adultTickets << endl;
- //Compute of Child Tickets Income
- childTicketsSold = childTickets * 3;
- cout << left << setw(30) << "Children Tickets Sold:" << right << setw(25) << childTickets << endl;
- cout << fixed << setprecision(2);
- //Compute of Gross Profit
- grossProfit = (childTicketsSold) + adultTicketsSold;
- cout << left << setw(30) << "Gross Box Office Profit:" << right << setw(24) << "$" << grossProfit << endl;
- //Compute of Amount Paid
- amountPaid = grossProfit * AMOUNT_PAID;
- cout << left << setw(30) << "Amount Paid to Distributor:" << right << setw(24) << "$" << amountPaid << endl;
- //Compute of Net Profit
- netProfit = grossProfit - amountPaid;
- cout << left << setw(30) << "Net Box Office Profit:" << right << setw(24) << "$" << netProfit << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement