Hi, I am developing a program with the following criteria:
Your program must accept as input the school the student is applying to (L or M), their high school grade point average, their math SAT score, their verbal SAT score and whether or not either parent is an alumnus (Y or N). The program must process several applicants, echoing the data for each applicant and printing a message indicating if the student was accepted to the school they were applying to. If they were not accepted, the message should indicate why. This message only has to indicate one reason for failure in cases of multiple disqualifications. Acceptances are to be made in the order received so that if a school is full, a later applicant cannot be accepted even if they happen to have better qualifications than an earlier one. You do NOT have to check for bad data coming from the file – assume that it is in the required format and has appropriate values.
The data file is arranged with the information for each applicant on a separate line. Your program must process the data until the end of file is reached, at which time the program must print out the total number of applicants and the number of acceptances to each school. The data file has been created for you and is located on the network mp3accept.txt.
Now my code looks fine but I think the main problem is that my data is not reinitializing and it holds onto the true values until it comes across a false value (pardon my nooby language). My code is as follows:
// if (school = 'L') // **** = is the assignment operator, it assigns the value 'L' to school
if (school == 'L') // == compares for equivalence - is the value in 'school' equal to 'L'?
And likewise in your other if statements.
Oh, and change this
1 2 3 4
while (fin.good())
{
fin >> school >> gpa >> mSAT >> vSAT >> alumni;
// ...
to
1 2 3
while( fin >> school >> gpa >> mSAT >> vSAT >> alumni )
{
// ...
I should have probably mentioned that parents being an alumni has an effect on the criteria. If the parent is an alumni, they get accepted at lower scores vs. the standard scores they get accepted as if their parents were not alumni.