fin1 xx.txt
--------------------
Paychecks 2500.00
Interest 100.00
fin2 xx.txt
--------------------
Car_Insurance 250.00
Cell_Phone 50.00
Book 200.00
Student_Loans 180.00
Rent 950.00
fin3 xx.txt
--------------------
Food 350.00
the output become
---------------------
Paychecks 2500.00 Car_Insurance 250.00 Food 350.00
Interest 100.00 Cell_Phone 50.00 Cell_Phone 50.00
Book 200.00
Student_Loans 180.00
Rent 950.00
------------------------------
problem : occur 2 cell phone, why? how to solve this problem ?
while ( fin1.good() || fin2.good() || fin3.good())
{
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
if ( !fin1.eof()) // i write 3 time of if ... which is same content and name fin1 fin2 and fin3
{
fin1 >> a >> b;
cout << setiosflags(ios::left) << setw(15)<< a << " RM "<< setw(7) << setprecision(2)<< b << " ";
sum1 = b + sum1;
count1 ++;
}
else
cout << setiosflags(ios::left) << setw(27)<<" " ;