I made a payroll program and cannot get it to write a dashed line once every 10 data entries. It is supposed to be like the picture below. My program computes the same thing without the dashed line. I thought my "If" statement was correct but when I try to run the program i get an error on the "==" sign that states "Cannot use % with floating-point types." Any suggestions?
http://imgur.com/xhr0K
http://imgur.com/xhr0K
void main()
{
float count, hours, rate, pay, tax, line;
string name;
cout << fixed << setprecision(2);
PrintHeader();
ifstream infile; // declars an input file object
infile.open("payroll.dat"); //opens the file payroll.dat
count = 1;
while ( count <= DATACOUNT )
{
infile >> name >> hours >> rate; //read data
pay = CalWages(hours, rate);
tax = pay * TaxRate(pay);
PrintPayRoll(name, hours, rate, pay, tax);
line = count;
if (line % 10 == 0)
PlotALine( SUBLINE , LINEWIDTH );
count++;
}
PlotALine( TITLELINE , LINEWIDTH );
}