Advertisement
Guest User

anton

a guest
Sep 16th, 2014
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1.  
  2. #include <iostream>
  3. #include <string>
  4. #include <iomanip>
  5. using namespace std;
  6.  
  7. int main ()
  8. {
  9. string movieName;
  10. int adultTickets, childTickets, childTicketsSold, adultTicketsSold;
  11. double grossProfit, amountPaid, netProfit;
  12. const double AMOUNT_PAID = .8;
  13.  
  14.  
  15. cout << "What was the name of the movie?";
  16. cin >> movieName;
  17. cout << "What was the total amount of adult tickets sold?\n";
  18. cin >> adultTickets;
  19. cout << "What was the total amount of child tickets sold?\n";
  20. cin >> childTickets;
  21.  
  22. cout << left << setw(30) << "Movie Name" << right << setw(25) << movieName << endl;
  23.  
  24. //Compute of Adult Ticket Income
  25. adultTicketsSold = adultTickets * 6;
  26. cout << left << setw(30) << "Adult Tickets Sold:" << right << setw(25) << adultTickets << endl;
  27.  
  28. //Compute of Child Tickets Income
  29. childTicketsSold = childTickets * 3;
  30. cout << left << setw(30) << "Children Tickets Sold:" << right << setw(25) << childTickets << endl;
  31.  
  32. cout << fixed << setprecision(2);
  33.  
  34. //Compute of Gross Profit
  35. grossProfit = (childTicketsSold) + adultTicketsSold;
  36. cout << left << setw(30) << "Gross Box Office Profit:" << right << setw(24) << "$" << grossProfit << endl;
  37.  
  38. //Compute of Amount Paid
  39. amountPaid = grossProfit * AMOUNT_PAID;
  40. cout << left << setw(30) << "Amount Paid to Distributor:" << right << setw(24) << "$" << amountPaid << endl;
  41.  
  42. //Compute of Net Profit
  43. netProfit = grossProfit - amountPaid;
  44. cout << left << setw(30) << "Net Box Office Profit:" << right << setw(24) << "$" << netProfit << endl;
  45. return 0;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement