Program Problem

I have a program that I cant figure out what is wrong with it. I get certain errors when I try to compile it. Any help would be GREATLY Appreciated.
The Error i get is: error: expected unqualified-id before â{â token

Here is the Program:



//William McDonald
#include <iostream>
using namespace std;


void airfare(double &airfareCost, double &airfareAllowed);
void milage(int &miles, double &milageCost, double &milageAllowed);
void taxi(int &taxiDays, double &taxiCost, double &taxiAllowed);
int main()
{
int taxiDays, miles;
double airfareCost, airfareAllowed;
double milageCost, milageAllowed;
double taxiCost, taxiAllowed;


airfare(airfareCost, airfareAllowed);
milage(miles, milageCost, milageAllowed);
taxi(taxiDays, taxiCost, taxiAllowed);


cout<<"Airfare Cost="<<airfareCost<<endl;
cout<<"Airfare Allowed="<<airfareAllowed<<endl;
cout<<"Milage Cost="<<milageCost<<endl;
cout<<"Milage Allowed="<<milageAllowed<<endl;
cout<<"Taxi Cost="<<taxiCost<<endl;
cout<<"Taxi Allowed="<<taxiAllowed<<endl;

return 0;
}

void airfare(double &airfareCost, double &airfareAllowed);
{
cout<< "Enter cost of Airfare"<<endl;
cin>>airfareCost;
airfareAllowed=airfareCost;
}

void milage(int &miles, double &milageCost, double &milageAllowed)
{
cout<< "Enter Number of miles driven"<<endl;
cin>>miles;
cout<< "Enter Milage Cost"<<endl;
cin>>milageCost;
milageAllowed=miles*0.38;

}


void taxi(int &taxiDays, double &taxiCost, double &taxiAllowed)
{
cout<<"Enter number of days taxi was used"<<endl;
cin>>taxiDays;
cout<<"Enter Taxi Cost"<<endl;
cin>>taxiCost;
taxiAllowed=taxiDays*10;

}
remove ";" at the end of---

void airfare(double &airfareCost, double &airfareAllowed);

then it compiles
Last edited on
i still get the same error
for which line of code?
He means the semi-colon here if you don't know where kyle means.

You have
1
2
3
4
5
void airfare(double &airfareCost, double &airfareAllowed); 
{
    cout<< "Enter cost of Airfare"<<endl;
    cin>>airfareCost;
    airfareAllowed=airfareCost;
}


After your remove it do a clean build.

[EDIT]Fixed noob mistake :)
Last edited on
I did remove it. But i still seem to get the same error.
What compiler are you using?
Got it to work! Thanks all! Been to 3 different forums in the last week and this was the first to reply.
Last edited on
What ended up being the problem out of curiosity?
void airfare(double &airfareCost, double &airfareAllowed

I accidently deleted the ) when i deleted the :
Mythios: Shirley, you mean "semicolon".
Even though I know it's spelled like that - I still have this issue of using my '-' key to much. So I write it like it without even realizing lol :(
Perhaps helios's point was for the spelling of colon which you wrote as column. :D
Ahahah oh god - I didn't pick that up I didn't realize i actually did that. /slap hand. Was all his fast typing fault.
Topic archived. No new replies allowed.