1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238
|
#include <iostream>
#include<cstdlib>
void JOTAKU_LOGO ();
//This function calls the flight agency's Logo.
void ABOUT_JOTAKUAIR ();
//This function displays a briefe history and information about J-Otaku Air.
double DOLLAR_TO_YEN (double dollar_Z);
//This function converts values from Dollar to Yen.
double DOLLAR_TO_Yuan (double dollar_Z);
//This function converts values from Dollar to Yuan (Chinese Yuan Renminbi).
double DOLLAR_TO_SINGAPORE_DOLLARS (double dollar_Z);
//This function converts values from Dollar to Singapore Dollars.
double DOLLAR_TO_PESO (double dollar_Z);
//This function converts values from Dollar to Phil.Peso.
using namespace std;
int main ()
{
//Declarations:
int num,travel_YN,num_destination,stat_pk,asia_pk,dom_destination,numb_seats,faq_choice,i;
long int contact_us [4]={7774332,7774344,7774487,7770988};
double dl_2_yn,tkt_cost,yen_tkt_cost,crvrtd_dl,convert_PS,dl_2_CNY;
char pick_YN,convert_YN,Passenger_name,faq_YN;
//Magic formula:
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(4);
//The main loop:
do
{
//call logo funcion.
JOTAKU_LOGO ();
cout << JOTAKU_LOGO;
cout<<"Welcome to J-Otaku-Air travel agency."<<endl;
cout<<"Before we get stated, Please enter your name: ";
cin >> Passenger_name;
do {
cin.get(Passenger_name);
cout << Passenger_name;
} while (Passenger_name != '\n');
cout<<"Hello "<<Passenger_name<<" and welcome to J-Otaku-Air travel agency."<<endl
<<"Please choose a number from the following menu, then press enter to "
<<"move to the desired page."<<endl<<endl
<<"1. About J-Otaku-Air"<<endl
<<"2. Reservations"<<endl
<<"3. Currency Converter"<<endl
<<"4. Budget Travels & Special Offers"<<endl
<<"5. Frequently asked questions"<<endl
<<"6. Contact us"<<endl
<<"* Press 0 to exit"<<endl<<endl;
cin>>num;
cout<<endl;
switch (num)
{
case 0:
cout << "End of program"<<endl;
break;
case 1: //first case of the main menu!
cout<<"1. About J-Otaku-Air"<<endl;
ABOUT_JOTAKUAIR ();
break;
case 2: //second case of the mian menu!
cout << "2. Reservations:"<<endl
<<endl
<< "Hello and welcome to the reservation area."<<endl
<< "Here you can choose your desired travel location and book a flight directly."<<endl
<<endl;
cout << "Do you intend on traveling internationally? (Y/N)\a"<<endl; /* Note that \a peeps a sound!*/
cin >>travel_YN;
if ((travel_YN=='N')|| (travel_YN=='n'))
//domestically:
cout << "You chose to travel domestically,"<<endl
<< "Please choose a destination from the following list:"<<endl;
cout << "1.Hiroshima"<<endl;
cout << "2.Nagasaki"<<endl;
cout << "3.Osaka"<<endl;
cout << "4.Yokohama"<<endl;
cout << "0 to exit this menu."<<endl;
cin >> dom_destination;
switch (dom_destination)
do {
case 1:
int numb_seats,Hiroshima_tkt;
char convert_YN,pick_YN;
cout << "You chose Hiroshima, is that correct? (Y/N)\a"<<endl;
cin >> pick_YN;
if ((pick_YN=='Y') || (pick_YN=='y'))
{
cout << "The price of each seat from Tokyo to Hiroshima costs 200 Dollars"<<endl;
cout << "Would you like to convert that amount into Yen?(Y/N)\a"<<endl;
cin >> convert_YN;
if ((convert_YN=='Y') || (convert_YN=='y'))
{
cout << "Please enter the value in Dollars that you want to convert to Yen"<<endl;
cin >> dl_2_yn;
crvrtd_dl = DOLLAR_TO_YEN (dl_2_yn);
cout << dl_2_yn << "$ = " <<crvrtd_dl<< " Yen "<<endl;
}
else
{
cout << "How many seats would you like to reserve?"<<endl;
cin >> numb_seats;
cout << "You have booked "<<numb_seats<< " seats."<<endl;
tkt_cost=200*numb_seats;
cout << "The total cost of your ticket(s) will be: "<<tkt_cost<<"$"<<endl;
yen_tkt_cost=tkt_cost*95.1384264;
cout << "which is "<<yen_tkt_cost<<" Yen."<<endl;
cout << "Dear, "<<Passenger_name<<endl;
cout << "You have booked a flight to Hiroshima."<<endl;
cout << "Please visit your nearest travel agency to confirm your reservation."<<endl;
cout << "Also, keep in mind that this ticket is only valade"<<endl;
cout << "for 3 months from the time of purchase."<<endl;
break;
}
}
case 2:
cout << "You chose Nagasaki, is that correct? (Y/N)\a"<<endl;
cin >> pick_YN;
if ((pick_YN=='Y') || (pick_YN=='y'))
cout << "The price of each seat from Tokyo to Nagasaki costs 200 Dollars"<<endl;
cout << "Would you like to convert that amount into Yen?(Y/N)\a"<<endl;
cin >> convert_YN;
if ((convert_YN=='Y') || (convert_YN=='y'))
{
cout << "Please enter the value in Dollars that you want to convert to Yen"<<endl;
cin >> dl_2_yn;
crvrtd_dl = DOLLAR_TO_YEN (dl_2_yn);
cout << dl_2_yn << "$ = " <<crvrtd_dl<< " Yen "<<endl;
}
else
{
cout << "How many seats would you like to reserve?"<<endl;
cin >> numb_seats;
cout << "You have booked "<<numb_seats<< " seats."<<endl;
tkt_cost=200*numb_seats;
cout << "The total cost of your ticket(s) will be: "<<tkt_cost<<"$"<<endl;
yen_tkt_cost=tkt_cost*95.1384264;
cout << "which is "<<yen_tkt_cost<<" Yen."<<endl;
cout << "Dear, "<<Passenger_name<<endl;
cout << "You have booked a flight to Nagasaki."<<endl;
cout << "Please visit your nearest travel agency to confirm your reservation."<<endl;
cout << "Also, keep in mind that this ticket is only valade"<<endl;
cout << "for 3 monthes from the time of purchase."<<endl;
}
break;
}
break;
case 3:
{
cout << "You chose Osaka, is that correct? (Y/N)\a"<<endl;
cin >> pick_YN;
if ((pick_YN=='Y') || (pick_YN=='y'))
{
cout << "The price of each seat from Tokyo to Osaka costs 200 Dollars"<<endl;
cout << "Would you like to convert that amount into Yen?(Y/N)\a"<<endl;
cin >> convert_YN;
if ((convert_YN=='Y') || (convert_YN=='y'))
{
cout << "Please enter the value in Dollars that you want to convert to Yen"<<endl;
cin >> dl_2_yn;
crvrtd_dl = DOLLAR_TO_YEN (dl_2_yn);
cout << dl_2_yn << "$ = " <<crvrtd_dl<< " Yen "<<endl;
}
else
{
cout << "How many seats would you like to reserve?"<<endl;
cin >> numb_seats;
cout << "You have booked "<<numb_seats<< " seats."<<endl;
tkt_cost=200*numb_seats;
cout << "The total cost of your ticket(s) will be: "<<tkt_cost<<"$"<<endl;
yen_tkt_cost=tkt_cost*95.1384264;
cout << "which is "<<yen_tkt_cost<<" Yen."<<endl;
cout << "Dear, "<<Passenger_name<<endl;
cout << "You have booked a flight to Osaka."<<endl;
cout << "Please visit your nearest travel agency to confirm your reservation."<<endl;
cout << "Also, keep in mind that this ticket is only valade"<<endl;
cout << "for 3 monthes from the time of purchase."<<endl;
}
break;
}
}
case 4:
{
cout << "You chose Yokohama, is that correct? (Y/N)\a"<<endl;
cin >> pick_YN;
if ((pick_YN=='Y') || (pick_YN=='y'))
{
cout << "The price of each seat from Tokyo to Yokohama costs 200 Dollars"<<endl;
cout << "Would you like to convert that amount into Yen?(Y/N)\a"<<endl;
cin >> convert_YN;
if ((convert_YN=='Y') || (convert_YN=='y'))
{
cout << "Please enter the value in Dollars that you want to convert to Yen"<<endl;
cin >> dl_2_yn;
crvrtd_dl = DOLLAR_TO_YEN (dl_2_yn);
cout << dl_2_yn << "$ = " <<crvrtd_dl<< " Yen "<<endl;
}
else
{
cout << "How many seats would you like to reserve?"<<endl;
cin >> numb_seats;
cout << "You have booked "<<numb_seats<< " seats."<<endl;
tkt_cost=200*numb_seats;
cout << "The total cost of your ticket(s) will be: "<<tkt_cost<<"$"<<endl;
yen_tkt_cost=tkt_cost*95.1384264;
cout << "which is "<<yen_tkt_cost<<" Yen."<<endl;
cout << "Dear, "<<Passenger_name<<endl;
cout << "You have booked a flight to Yokohama."<<endl;
cout << "Please visit your nearest travel agency to confirm your reservation."<<endl;
cout << "Also, keep in mind that this ticket is only valade"<<endl;
cout << "for 3 monthes from the time of purchase."<<endl;
break;
}
}
break;
}
switch (num_destination)
|