I am trying to get this program to execute and it keeps giving me error and my debugger is not working help please :0)
C:\Program Files\Microsoft Visual Studio\MyProjects(12): error C2065: 'tickets' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\(13) : error C2065: 'cost' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects(13) : error C2296: '*' : illegal, left operand has type 'int [6]'
C:\Program Files\Microsoft Visual Studio\MyProjects\(19) : error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'int [6]' (or there is no acceptable conversion)
Error executing cl.exe.
4 error(s), 0 warning(s)
# include <iostream>
# include <iomanip>
using namespace std;
int main()
{
cout << setprecision(2)
<<setiosflags(ios::fixed)
<<setiosflags(ios::showpoint);
double city_price[6] = {56.79, 105.69, 93.49, 155.99, 87.49, 73.99};
tickets = 0<5;
cost = city_price * tickets;
char response;
do
{
cout << endl <<endl <<"What is the number of your desitantion city?";
cin >> city_price;
cout << endl << endl <<"How many tickets do you wish to purchase?";
cin >> tickets;
cout << endl << endl << "The cost is: ";
cin >> cost;
cout << endl << endl;
cout << "City and Price:" << setw(7) << city_price << endl;
cout << "Number of tickets:" << setw(7) << tickets << endl;
cout << "-------------------" << endl;
cout << "Your cost:" << setw(7) << cost << endl;
cout << "Do you wish to purchase more tickets? (Y/N): ";
cin >> response;
}
while (response == 'Y' || response == 'y');
return 0;
}
Tags: