|
i have to design a progarm that calculate the toll for each customer from a log file and produce a tax invoive i have done that but i still got a lot of error if you can help me to solve the problem
#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 ('/index.html');
date = ipstring.substr
time = 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
|
|
|
Your major problem is with syntax.
Variables cannot have dashes in thair names (i.e. max-line). Data passed to functions must conform to the argument list of that function. For loop arguments need to be separated by semi-colons. Etc. etc.
You'll need to clean up the syntax errors first before we can tell what is going on here.
|
|
|
|
|
|
|
// |