This error appeared when I tried compiling theprogram:
Code:
fatal error C1075: end of file found before the left brace '{' at 'c:\Documents and Settings\TinkerBell\My Documents\Visual Studio Projects\new280\new280.cpp(4)' was matched
Here is my code: (I know it's long.. but the program itself does not matter... I think it's the include...)
Thanks, The utterly confused
Code:
#include <iostream>
using namespace std;
main()
{
int hour, time_day;
char veh[6];
cout << "Do you drive a car or a truck?" << "\n";
cin >> veh;
cout <<"You drive a " << veh <<"\n";
cout << "Please choose how many hours you parked:" << "\n";
cout << "1. 1 hour" << "\n";
cout << "2. 2 hours" << "\n";
cout << "3. more than two hours" << "\n";
cin >> hour;
cout << "You have to pay: " << "\n";
switch(hour)
{ case(3): {cout << "$5" << "+" << "\n";}
case(2): {cout << "$3" << "+" << "\n";}
case(1): {cout << "$2" << "\n";}
}
if( !strcmp(veh, "truck") ) /* strcmp returns 0 if veh equals to "truck" */
cout << "+$1" << "\n";
cout << "When did you park ? ";
cout << "1. Before 8 A.M" << "\n";
cout << "2. Before 5 P.M" << "\n";
cout << "3. After 5 p.m" << "\n";
cin >> time_day;
switch(time_day)
{case(1): {cout << "That's all thank you";
break;}
case(2): {cout << "You have to pay 50 cents more";
break;}
case(3) : {cout << "You get back 50 cents";
break;
}
return 0;}