Advertisement
Guest User

Untitled

a guest
Oct 18th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include<iomanip>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int junior,senior;
  9. string trace;
  10. getline (cin,trace);
  11. cin>>junior>>senior;
  12.  
  13.  
  14. int participant=junior+senior;
  15. double money;
  16. double total_money;
  17. double discount;
  18. double tax;
  19.  
  20.  
  21. if(trace=="cross country")
  22. {
  23. if(participant>=50)
  24. {
  25. discount=((junior*8)+(senior*9.50))*0.25;
  26. money =(junior*8)+(senior*9.50)-discount;
  27. tax=money*0.05;
  28. total_money = money-tax;
  29. cout<<fixed<<setprecision(2)<<total_money;
  30. cout << "\n AAAAAAAAAAAAAAAAAAAAA";
  31. }
  32. else
  33. {
  34. money=(junior*8)+(senior*9.50);
  35. tax=money*0.05;
  36. total_money = money-tax;
  37. cout<<fixed<<setprecision(2)<<total_money;
  38. cout << "\n BBBBBBBBBBBBBBBBBBBBBB";
  39. }
  40. }
  41.  
  42.  
  43. else if(trace=="trail")
  44. {
  45. money=(junior*5.50)+(senior*7);
  46. tax=money*0.05;
  47. total_money = money-tax;
  48. cout<<fixed<<setprecision(2)<<total_money;
  49. }
  50.  
  51.  
  52.  
  53. else if(trace=="downhill")
  54. {
  55. money=(junior*12.25)+(senior*13.75);
  56. tax=money*0.05;
  57. total_money = money-tax;
  58. cout<<fixed<<setprecision(2)<<total_money;
  59. }
  60.  
  61.  
  62. else if (trace=="road")
  63. {
  64. money=(junior*20)+(senior*21.50);
  65. tax=money*0.05;
  66. total_money = money-tax;
  67. cout<<fixed<<setprecision(2)<<total_money;
  68. }
  69.  
  70.  
  71. return 0;
  72.  
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement