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()
- {
- int junior,senior;
- string trace;
- getline (cin,trace);
- cin>>junior>>senior;
- int participant=junior+senior;
- double money;
- double total_money;
- double discount;
- double tax;
- if(trace=="cross country")
- {
- if(participant>=50)
- {
- discount=((junior*8)+(senior*9.50))*0.25;
- money =(junior*8)+(senior*9.50)-discount;
- tax=money*0.05;
- total_money = money-tax;
- cout<<fixed<<setprecision(2)<<total_money;
- cout << "\n AAAAAAAAAAAAAAAAAAAAA";
- }
- else
- {
- money=(junior*8)+(senior*9.50);
- tax=money*0.05;
- total_money = money-tax;
- cout<<fixed<<setprecision(2)<<total_money;
- cout << "\n BBBBBBBBBBBBBBBBBBBBBB";
- }
- }
- else if(trace=="trail")
- {
- money=(junior*5.50)+(senior*7);
- tax=money*0.05;
- total_money = money-tax;
- cout<<fixed<<setprecision(2)<<total_money;
- }
- else if(trace=="downhill")
- {
- money=(junior*12.25)+(senior*13.75);
- tax=money*0.05;
- total_money = money-tax;
- cout<<fixed<<setprecision(2)<<total_money;
- }
- else if (trace=="road")
- {
- money=(junior*20)+(senior*21.50);
- tax=money*0.05;
- total_money = money-tax;
- cout<<fixed<<setprecision(2)<<total_money;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement