Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. const double W_adult=47.90, W_child=41.50, W_senior=35.40, A_adult=25.90, A_child=20.50, A_senior=15.40, P_adult=15.90, P_child=12.50, P_senior=10.40;
  8. double totaladult,totalchild,totalsenior, total;
  9. int noadult,nochild,nosenior;
  10. char option;
  11. //char choice = 'y'; looping choice
  12.  
  13. cout<<"WELCOME TO WAS LOST WORLD THEME PARKnn"<<endl;
  14. cout<<setw(80)<<setfill('*')<<"*";
  15. cout<<"nPackage name t | ADULTt | CHILDt | SENIOR CITIZEN"<<endl;
  16. cout<<"|A| Water Parkt | 47.90t | 41.50t | 35.40"<<endl;
  17. cout<<"|B| Am. Parkt | 25.90 t | 20.50 t | 15.40"<<endl;
  18. cout<<"|C| Pet. Zoot | 15.90t | 12.50t | 10.40"<<endl<<endl;
  19. cout<<setw(80)<<setfill('*')<<"*";
  20.  
  21.  
  22. cout<<"nChoose your package A/B/C: "<<endl;
  23. cin>>option;
  24.  
  25.  
  26. cout<<"Enter the no of adult: "<<endl;
  27. cin>>noadult;
  28. cout<<"Enter the no of child: "<<endl;
  29. cin>>nochild;
  30. cout<<"Enter the no of senior citizen: "<<endl;
  31. cin>>nosenior;
  32.  
  33. switch(option)
  34. {
  35. case 'A':
  36. case 'a':
  37. totaladult=W_adult*noadult;
  38. totalchild=W_child*nochild;
  39. totalsenior=W_senior*nosenior;
  40.  
  41. break;
  42.  
  43. case 'B':
  44. case 'b':
  45. totaladult=A_adult*noadult;
  46. totalchild=A_child*nochild;
  47. totalsenior=A_senior*nosenior;
  48.  
  49. break;
  50.  
  51. case 'C':
  52. case 'c':
  53. totaladult=P_adult*noadult;
  54. totalchild=P_child*nochild;
  55. totalsenior=P_senior*nosenior;
  56.  
  57. break;
  58. }
  59.  
  60. cout<<"Total no of adult is: "<<noadult<<endl;
  61. cout<<"Total no of child is: "<<nochild<<endl;
  62. cout<<"Total no of senior citizen is: "<<nosenior<<endl;
  63. cout<<"Total price of adult is: "<<totaladult<<endl;
  64. cout<<"Total price of child is: "<<totalchild<<endl;
  65. cout<<"Total price of senior citizen is: "<<totalsenior<<endl;
  66. cout<<"The total price is: "<<totaladult+totalchild+totalsenior<<endl;
  67.  
  68. return 0;
  69.  
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement