Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

How to add a dashed (----) Line Every 10 Lines

$
0
0
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

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 );
}


Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>