hye, i've just write a program which ask about calculate the price, total number of adult and child and total price. but when i run the program its contain exponent, not the exact value of calculation.
#include<iostream>
using namespace std;
int main ()
{
int adult, passenger, child;
char code, X, Y, Z;
float price1, price2, totalPrice=0.00;
cout<<"**********************************************"<<endl;
cout<<"* Package Trip Package Code *"<<endl;
cout<<"* Istanbul X *"<<endl;
cout<<"* Beijing Y *"<<endl;
cout<<"* Tokyo Z *"<<endl;
cout<<"**********************************************"<<endl;
cout<<" Choose your package trip by insert the code : ";
cin>>code;
cout<<" insert the total passenger : ";
cin>>passenger;
cout<<" adults : ";
cin>>adult;
cout<<" children : ";
cin>>child;
cout<<endl;
while (passenger =! 1)
{
if (code = X)
{
price1 = 4000.00;
price2 = 2100.00;
}
else if (code = Y)
{
price1 = 2300.00;
price2 = 1400.00;
}
else if (code = Z)
{
price1 = 3800.00;
price2 = 1800.00;
}
#include<iostream>
usingnamespace std;
int main ()
{
int adult, passenger, child;
char code, X, Y, Z;
float price1, price2, totalPrice=0.00;
// ...
while (passenger =! 1)
{
if (code = X) // *** warning: X is uninitalized
// *** warning: assignment in predicate; did you intend to use == ?
{
// ...
}
// else if (code = Y) / *** warning: X is uninitalized
// *** warning: assignment in predicate; did you intend to use == ?
// else etc ...
}
// ...
system ("PAUSE"); // *** error 'system' undeclared
return 0;
}