Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Nov 13th, 2018 90 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main() {
  4.     int time,type,clock=600,fare=0;
  5.     cout<<"Enter Time: 30 for 30 minutes, 60 for 60 minutes."<<endl;
  6.     cin>>time;
  7.     while (true){
  8.         if(time!=30&&time!=60){
  9.         cout<<"wrong time! try again"<<endl;
  10.         cin>>time;
  11.     }
  12.     else break;
  13.     }
  14.         cout<<"Plane Type: 1 for 2 seater, 2 for 4 seater, 3 for historic plane."<<endl;
  15.     cout<<"Enter Plane type"<<endl;
  16.     cin>>type;
  17.     while (true){
  18.         if (type!=1&&type!=2&&type!=3){
  19.             cout<<"Error: invalid plane type!"<<endl;
  20.             cin>>type;
  21.         }
  22.         else break;
  23.     }
  24.        
  25.     if (time==30){
  26.         while(clock>=30){
  27.         if (type==3){
  28.                 fare+=300;
  29.                 clock-=60;
  30.             }
  31.         else if (type==1){
  32.             fare+=100;
  33.             clock-=60;
  34.         }
  35.         else if (type==2){
  36.             fare+=120;
  37.             clock-=60;
  38.         }
  39.     }
  40. }
  41.     else if (time==60){
  42.         while(clock>=60){
  43.         if (type==3){
  44.                 fare+=500;
  45.                 clock-=90;
  46.             }
  47.         else if (type==1){
  48.             fare+=150;
  49.             clock-=90;
  50.         }
  51.         else if (type==2){
  52.             fare+=200;
  53.             clock-=90;
  54.         }
  55.     }
  56.     }
  57.     cout<<"Max. Fare: $"<<fare;
  58. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top