Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int main()
- {
- 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;
- double totaladult,totalchild,totalsenior, total;
- int noadult,nochild,nosenior;
- char option;
- //char choice = 'y'; looping choice
- cout<<"WELCOME TO WAS LOST WORLD THEME PARKnn"<<endl;
- cout<<setw(80)<<setfill('*')<<"*";
- cout<<"nPackage name t | ADULTt | CHILDt | SENIOR CITIZEN"<<endl;
- cout<<"|A| Water Parkt | 47.90t | 41.50t | 35.40"<<endl;
- cout<<"|B| Am. Parkt | 25.90 t | 20.50 t | 15.40"<<endl;
- cout<<"|C| Pet. Zoot | 15.90t | 12.50t | 10.40"<<endl<<endl;
- cout<<setw(80)<<setfill('*')<<"*";
- cout<<"nChoose your package A/B/C: "<<endl;
- cin>>option;
- cout<<"Enter the no of adult: "<<endl;
- cin>>noadult;
- cout<<"Enter the no of child: "<<endl;
- cin>>nochild;
- cout<<"Enter the no of senior citizen: "<<endl;
- cin>>nosenior;
- switch(option)
- {
- case 'A':
- case 'a':
- totaladult=W_adult*noadult;
- totalchild=W_child*nochild;
- totalsenior=W_senior*nosenior;
- break;
- case 'B':
- case 'b':
- totaladult=A_adult*noadult;
- totalchild=A_child*nochild;
- totalsenior=A_senior*nosenior;
- break;
- case 'C':
- case 'c':
- totaladult=P_adult*noadult;
- totalchild=P_child*nochild;
- totalsenior=P_senior*nosenior;
- break;
- }
- cout<<"Total no of adult is: "<<noadult<<endl;
- cout<<"Total no of child is: "<<nochild<<endl;
- cout<<"Total no of senior citizen is: "<<nosenior<<endl;
- cout<<"Total price of adult is: "<<totaladult<<endl;
- cout<<"Total price of child is: "<<totalchild<<endl;
- cout<<"Total price of senior citizen is: "<<totalsenior<<endl;
- cout<<"The total price is: "<<totaladult+totalchild+totalsenior<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement