help in c++ program
please help find the error and correct them in this program
#include <cstdlib>
#include <iostream>
using namespace std;
void print mainheading(int& pagecount, int& linecount);
void print columnheading(int& pagecount, int& linecount);
void tolldetails(int& max-line, int& max-size, string& date, string& time,i, ipstring, int$ gate);
void caluculatetoll ( string& station, int& i, double& a, double& b ,double& c, double& d, double& total, double& contotal);
void reset contotal( double& contotal)
void Print tax invoice ( int&, char&, double&, double&, double&, double&);
const int max-lines =100;
const max-line =100;
const int max-size = 20;
double total = 0;
int linecount =0;
bool more = true;
void print mainheading (int pagecount, int& linecount)
{
pagecount = pagecount +1;
cout<<" Interstate Motorway tax invoice"<<endl;
cout<<" customer id\tname\tadress\n";
line count =2;
}
void print columnheading (init pagecount; int& linecount)
{
pagecount = pagecount +1;
cout<< "Date\t\t time\t\t Amount\n\n";
lne count=1;
}
void tolldetails(int& max-line, int& max-size, string& date, string& time,i, ipstring, int$ gate)
{
date [max-size];
time [max-size];
i =0;
do
{
cerr <<" proceeding:"<< endl;
getline (cin, ipstring);
if(cin.fail())
break;
int gate = ipstring.find ('/');
date[i] = ipstring.substr
time[i] = ipstring.substr
i++;
}
while (i< max-size);
for ( int j=0, j<i, j++)
cout<< date [j]<<"\t" << time[j]<< endl;
}
void caluculate toll ( string& station, int& i, double& a, double& b ,double& c, double& d, double& total, double& contotal)
{
a = 0;
b = 0;
c = 0;
d = 0;
int j = 0
do
{
if (station [j] == "A")
{
a = a + 2.20;
cout <<a;
}
else if (station[j] == "B")
{
b = b + 2.80;
cout <<b;
}
else if ( station [j] == "C")
{
c = c+ 2.30;
cout<< c;
}
else if ( station [j] == "D")
{
d = d + 3.80;
cout<< d;
}
total = a+ b + c + d;
cout << "THE TOTAL AMOUNT IS"<< total<< endl;
cout<< " PLEASE MAKE THE PAYMENT AS SOON AS YOU CAN"<< endl;
resetcontotal ( contotal);
}
while (j< i);
}
void reset contotal( double& contotal)
{
contotal = 0;
}
int main ()
{
int currentid;
int previd;
string custid;
string prevcustid;
double total;
double contotal;
int linecount;
previd = currentid;
prevcustid = custid;
while (more)
{
if ( currentid = previd)
caluculate total ( max-size, station, i, a, b,c, d)
previd= currentid;
prevcustid= custid;
a}
if (linecount > max-lines)
print main heading (linecount);
print column heading (linecount);
read tolldetails ( max-line, max-size, date, time, ipstring, i,gate);
calculate total( max-size, station, a,b,c,d,total);
system ("pause");
return 0;
and thx for your help
[4520 byte] By [
halloula] at [2007-11-11 8:48:40]

# 2 Re: help in c++ program
Well, you could start by removing the spaces in your function and variable names. You're not trying to get us to do your school assignment for you, by any chance?
Rune
the assigment asked me to build the program and that's what i've done but i still got errors i reached this final stage now but i still got problems
#include <iostream>
#include <string.h>
using namespace std;
void print_main_Heading(int&, int&);
void print_Column_Heading(int&, int&);
void readtolldetails (int& , int& , string& , string& , string& ,int& , int& );
void calculateToll(int& , char& , int& , float& , float& , float& , float& );
void resetContotals(double&);
void printTotalInvoice (const int& , char& , float& , float& , float& , float& , float& );
const int MAX_LINES =100;
const int MAX_LINE = 100;
const int MAX_SIZE = 20;
double TotalInvoice = 0;
int pageCount = 0;
int lineCount = 0;
bool more= true;
void print_main_Heading(int& pageCount, int& lineCount)
{
pageCount = pageCount +1;
cout<<"Interstate motorway tax invoice"<<endl;
cout<<"cutomer id\tname\adress" ;
lineCount = 2;
}
void printCustomerHeading(int& pageCount, int& lineCount)
{
pageCount = pageCount +1;
cout<<"DATE\t\tTIME\tAMOUNT\n\n";
lineCount = 1;
}
void readtolldetails (int& MAX_LINE, int& MAX_SIZE, string& date, string& time, string& ipString,int& i, int&gate)
{
date [MAX_SIZE];
time [MAX_SIZE];
ipString;
i =0;
do {
cerr<<"proceeding..."<<endl;
getline(cin, ipString);
if(cin.fail()) break;
int position = ipString.find ('/');
date [i] = ipString.substr(0, 10);
time [i] = ipString.substr(11,16-11);
i++;
}
while (i<MAX_SIZE);
for (int j=0; i<j; i++)
cout <<date[j]<<"\t"<<time[j]<<endl;
}
void calculatetoll (string& station, int i, float& a, float& b, float& c, float&d,float& total, double& contotal)
{
a = 0;
b = 0;
c = 0;
d = 0;
int j = 0;
do
{
if (station [j] == "A")
{
a= a + 2.20;
cout<<a;
}
else if(station[j] == " B")
{
b= b + 2.80;
cout<<b;
}
else if(station[j] == "C")
{
c= c + 2.30;
cout<<c;
}
else if(station[j] == "D")
{
d= d + 3.80;
cout<<d;
}
total = a + b+ c + d;
cout<<"TOTAL:" << total <<endl;
cout<<"please make payment as soon as possible."<<endl;
resetContotals(contotal);
}
while(j < i);
}
void resetContotals(double& contotal)
{
contotal = 0;
}
int main ()
{
int currentid;
int previd;
string custid;
string prevcustid;
double contotal;
int pageCount;
int lineCount;
char station;
int i;
float a, b, c, d, total;
string ipstring;
previd =currentid;
prevcustid=custid;
while(more)
{
if (currentid!=previd)
calculateToll (MAX_SIZE, station, i , a , b, c, d);
previd= currentid;
prevcustid= custid;
}
if (lineCount >MAX_LINES)
print_main_Heading(pageCount, lineCount);
print_Column_Heading(pageCount, lineCount);
readtolldetails (MAX_LINE, MAX_SIZE,ipString, i);
calculateToll(MAX_SIZE, station, i, a, b, c, d );
printTotalInvoice (MAX_SIZE, station, a, b, c, d, total);
system("pause");
return 0;
}
dont accuse peope