Hi everyone,
I am new here and new to C++ I am taking an intro class and am stuck on an assignment. Heres the thing the code has to read from the file and loop to get the info. The program :
// reads in the number of salespeople
// reads in the quota for that salesperson
// reads in 12 actual monthly sales counts for that salesperson
// determines number of months the salesperson did or did not meet quota
// decides whether a campaign should be mounted
// identifies the worst salesperson for meeting quotas
The problem I am having is looping so that it will read each line/salesPerson
Here is what I have so far and it does output the first and second lines from the .dat file


infile >> salesPerson;
infile>> quota;
cout << salesPerson << "\t" << quota << "\t";
infile >> salesPerson;

while (infile.good())
{
infile >> month;//there are 12 months
cout << month << " ";
}

cout << "\t" << under;
cout << "\t" << quotaAndAbove;

system("pause");

Thanks in advance!