Line 31: There are three parts to a for loop statement. The initialization; the termination condition; and the increment. I only see two parts.
Your termination condition (water+water) doesn't make sense. I see no increment.
If amount is the number of customers, then I would expect your for loop to look like:
1 2 3 4
|
for (int custnum = 0; custnum < amount; custnum++)
{ // Do something for each customer
}
|
It is unusual to use a for loop when reading from a file. It is more common to read from the file until your read from the file fails.
amount is a poor choice of a variable name for the number of customers. amount usually refers to a dollar amount on a bill.
You haven't specified the format of the input file, so I can't make suggestions about reading the file. Are water, gas, electricity all on the same line? What about customer information?
line 33: the
break
statement is going to cause you to exit the for loop on the first iteration.
edit: OP has deleted his code.