Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A small prestigious university needs to implement a computerized system for dete

ID: 3880451 • Letter: A

Question

A small prestigious university needs to implement a computerized system for determining accceptance. The university has two schools, Liberal Arts and Music, each with their own criteria for accepting students. The program must read in certain information about an applicant and print a message saying whether the applicant should be accepted or not.

The criteria for acceptance are:

Liberal Arts

No more than 5 people can be accepted.

If a parent is an alumnus, the GPA must be at least 3.0, but if no parents are alumni the GPA must be at least 3.5.

If a parent is an alumnus, the combined SAT score must be at least 1000, but if no parents are alumni the SAT must be at least 1200.

Music – no preferences for alumni here.

No more than 3 people can be accepted.

Math and verbal SAT’s must be at least 500.

The 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. The program does 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. The 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 should be created by you. Create the file and store it in the same project folder as your program. Please turn in a hard copy of this file along with your program and output. Remember to use good style with consistent indentation, plenty of comments, good variable names etc. and don't forget to echo the data as it is read. The output must be clear and readable with appropriate string constants and spacing. THE OUTPUT MUST BE IN THE EXACT FORMAT AS SHOWN BELOW!

Here is an example of the input data file:

L 4.0 600 650 N
M 3.9 610 520 N
L 3.8 590 600 N

Sample output from the first few lines of the data file follows:

Acceptance to College Program

Applicant #: 1
School = L GPA = 4.0 math = 600 verbal = 650 alumnus = N
Applying to Liberal Arts
Accepted to Liberal Arts!!!
*******************************
Applicant #: 2
School = M GPA = 3.9 math = 610 verbal = 520 alumnus = N
Applying to Music
Accepted to Music!!
*******************************
Applicant #: 3
School = L GPA = 3.8 math = 590 verbal = 600 alumnus = N
Applying to Liberal Arts
Rejected - SAT is too low
*******************************

There were xx applicants in the file
There were xx acceptances to Liberal Arts
There were xx acceptances to Music
Press any key to continue

Included below is the text file to be used that conatinas the information of each applicant.


mp3accept.txt

L 4.0 600 650 N
M 3.9 610 520 N
L 3.8 590 600 N
L 3.0 600 600 Y
L 3.4 600 600 N
L 3.0 500 490 Y
L 2.9 500 500 Y
M 3.5 500 490 Y
M 3.9 490 600 Y
L 3.5 700 500 N
L 3.1 600 400 Y
L 3.0 490 510 Y
L 4.0 800 800 Y
M 3.2 500 500 N

Explanation / Answer

From the given criteria for Liberal Arts it is clear that:

From given criteria for Music it is clear that:

Given below is a python code which achieves the task:

The code works by reading each line of the input file till it reaches the end of the file.

For each line read, the line is split on delimiter ' '(space). This results in a list of splitted elements of that line.

eg. If the linput line was

it gets split into a list like:-

['L','4.0','600','650','N']

As we know the format of the input ie. First column = School , Second column = GPA etc, we can access this list by using indexes from 0 to 4 to get individual values for every applicant.

Then we split our check based on the School being applied to. Hence we have the outermost if else loop to split as per school applied.

ie. if school is Liberal Arts

Further check for Liberal Arts criteria

else

It is a Music school applicant and hence further check Music criteria

As and when the applicant is accepted , the liberal_admitted or music_admitted counters are incremented by 1 to keep track of how many are admitted in the respective schools.

At the end we close the file (using close() method) once all lines are read .

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote