Advertisement
alexpeevk9

01. Agency Profit

Feb 13th, 2022
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     string name;
  7.     int adultTicketsNumber, childTicketsNumber;
  8.     double netPriceAdult, taxPrice, finalPrice, finalOutPut;
  9.     cin >> name;
  10.     cin >> adultTicketsNumber;
  11.     cin >> childTicketsNumber;
  12.     cin >> netPriceAdult;
  13.     cin >> taxPrice;
  14.     double priceChildTickets = netPriceAdult * 0.3;
  15.     double childTicket = priceChildTickets + taxPrice;
  16.     double adultTicket = netPriceAdult + taxPrice;
  17.     finalPrice = (childTicketsNumber * childTicket) + (adultTicketsNumber * adultTicket);
  18.     finalOutPut = finalPrice * 0.20;
  19.     cout.setf(ios::fixed);
  20.     cout.precision(2);
  21.     cout << "The profit of your agency from " << name << " tickets is " << finalOutPut << " lv." << endl;
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement