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

College Admissions You have been hired by a small college to help automate their

ID: 3673504 • Letter: C

Question

College Admissions

You have been hired by a small college to help automate their admission process. The college has three schools -- Engineering, Liberal Arts, and Fine Arts. Each school has different entrance requirements and uses different criteria to select applicants. This makes it difficult to determine whether to Admit, Defer, or Deny each applicant. Having the necessary logic incorporated into a computer program will make this process much easier and help eliminate human error.

Requirements

For this project, you will write a program named Admissions that automates the admission selection process for a college. The college has a three schools —Engineering, Liberal Arts, and Fine Arts. All applicants submit an essay that is given a score ranging from 1 to 4. Applicants to the Engineering and Liberal Arts schools provide critical Reading and Math SAT scores while the Fine Arts applicants submit a portfolio instead — each portfolio is rated as Excellent, Good, Fair, or Poor. Based on the specific criteria listed below for each school, each applicant is given an admission status of "Admit", "Defer", or "Deny". However, applicants with an admission status of "Defer" who have two or more Alumni family members will be upgraded to "Admit" status.

Engineering School

Applicants with an essay score less than 2, a Math SAT score below 500, or a Reading SAT score below 400 will receive a "Deny" status. Other applicants who have a Math SAT score of 700 or better and a Reading SAT score of 600 or better will receive an "Admit" status while those with a Math SAT score of 500 or better and a Reading SAT score of 400 or better will receive a "Defer" status.

Liberal Arts School

Applicants with an essay score less than 3, a Math SAT score below 400, or a Reading SAT score below 500 will receive a "Deny" status. Other applicants who have a Math SAT score of 500 or better and a Reading SAT score of 650 or better will receive an "Admit" status while those with a Math SAT score of 400 or better and a Reading SAT score of 500 or better will receive a "Defer" status.

Fine Arts School

Applicants with an essay score less than 2, or a Portfolio rating of "Poor" or "Fair" will receive a "Deny" status. Other applicants who have a Portfolio rating of "Excellent" will receive an "Admit" status while those with a Portfolio rating of "Good" will receive a "Defer" status.


Your program must display a header that lists the name of the application and provides instructions about using the program. For example,

The user should be prompted for the following input values:

The applicant's name.

The school (E, L, F). The school must be entered as a single character. Both upper- and lowercase characters should be accepted.

The essay score (1 - 4).

If the school is Engineering or Liberal Arts, the user should be prompted for

Math SAT score.

Reading SAT score.

If the school is Fine Arts, the user should be prompted for

Portfolio rating (E, G, F, P). The rating must be entered as a single character. Both upper- and lowercase characters should be accepted.

Number of alumni family members.

The program should then output the applicant's admission status of Admit, Defer, or Deny.

Here are some examples; you must prompt the user for the input values in the same order as shown in the examples:

Error Handling

If the user enters an invalid school, an essay score below 1 or greater than 4, an SAT score below 200 or greater than 800, an invalid portfolio rating, or a negative integer for the number of alumni family members, the program should print "Invalid input" and immediately quit. HINT: The statement System.exit(1); will cause the program to quit with a status of 1 indicating an error condition. NOTE that you do not need to handle the situation where the user enters something other than an integer when an integer is expected. We will learn to handle this later in the semester.

Here are several examples of handling invalid input:

Design

The program must contain and use the completed version of the getAdmissionStatus() method below. You are free to define and use additional methods, if you like; be sure to provide Javadoc for them and include them in your structure diagram. Replace the comments below with appropriate Javadoc.

Even though you should do thorough error checking of the input values and exit the program as soon as an invalid value is entered, you must also do error checking of the parameter values within the getAdmissionStatus() methodand throw an IllegalArgumentException(), if any parameter value is invalid as described below. This requirement is simply to give you practice in checking method parameters and throwing exceptions.

Implementation

Use named constants in your program rather than magic numbers. As of March 16, 2016, the SAT scoring structurewill change somewhat and the college may want to update their SAT score requirements. Defining the SAT-related values as constants will make this process easier for them.

NOTE that the process of validating the input values and exiting the program when an invalid value is entered istotally independent of checking the parameter values within the getAdmissionStatus() method and throwing an exception if a parameter value is invalid.

Explanation / Answer

<html>

<head>

<title> JAVA ADMISSIONS </title>

<h1> Welcome to the College Admission Program! </h1>

<script type=”text/javascript”>

function Admission () {

var name = prompt(“ enter Applicant name:”);

var school = prompt(“enter school:”);

var escore = prompt(Enter Essay score:”);

if(school = = E|| L)

{

var Msat = prompt(“enter math sat score:”);

var Rsat = prompt(“enter reading sat score:”);

}else

{

var portfolio = prompt(“ Enter portfolio:”);

int ch;

switch(ch) {

case 1: Excellent; break;

case 2:Good; break;

case 3: Fair; break;

case 4: Poor; break;

}

}

var al=prompt(“enter alumni family members:”);

void getAdmissionStatus() {

int Msat,Rsat,escore;

char portfolio,ch;

document.documentElement(escore);

document.documentElement(Msat);

document.documentElement(Rsat);

document.documentElement(portfolio);

document.write(“enter choice:” + ch);

switch(ch) {

case ‘E’ : Engineering School; break;

case ‘L’ : Liberal Arts School; break;

case ‘F’ : Fine Arts School; break;

}

if (ch = = ‘E’) {

if(escore<2) {

if(Msat <500 && Rsat <400) {

var status = prompt(“Deny”);

} else if(Msat>=700 && Rsat>=600) {

var status = prompt(“Admit”); }

else if(Msat >500 && Rsat>400) {

var status = prompt(“Defer”);

} } } else document.write(false);

if (ch ==’L’) {

if (escore<3) {

if(Msat <400 && Rsat <500) {

var status = prompt(“Deny”); }

else if(Msat >=500 && Rsat >=650) {

var status = prompt(“Admit”); }

else if(Msat>=400 && Rsat >=500) {

var status = prompt(“Defer”); }

}

} document.write(false);

if(ch == ‘F’) {

if (escore <2) {

if(portfolio = = ‘P’ || ‘F’) {

var status = prompt(“Deny”); }

else if(portfolio == ‘G’) {

var status = prompt(“Defer”); }

else var status = prompt(“Admit”);

}

} else document.write(false);

if (status == ‘Defer’) {

document.documetElement(al);

if(al >=2) {

var status = prompt(“Admit”); }

} else document.write(false);

}

void invalidInput() {

int escore,Msat,Rsat,al;

String portfolio,school;

document.documentElement(escore);

document.documentElement(Msat);

document.documentElement(Rsat);

document.documentElement(portfolio);

document.documentElement(school);

document.documentElement(al);

if(school != ‘E’|| ‘L’ || ‘F’)

{

document.write(“Invalid Input”);

System.exit(1); }

else if(escore <1 || escore>4) {

document.write(“Invalid Input”);

System.exit(1); }

else if(Msat<200 || Msat>800) {

document.write(“Invalid Input”);

System.exit(1); }

else if(Rsat<200 || Rsat>800) {

document.write(“Invalid Input”);

System.exit(1); }

else if(portfolio != ‘P’ ||’F’|| ‘G’|| ‘E’)

{

document.write(“Invalid Input”);

System.exit(1); }

else document.write(true);

}

}

document.close();

}

</script>

</head>

<body>

name : <input type = “text” size=20 name=”string”/>

school : <input type=”text” size=20 name = “string”/>

escore: <input type=”text “ size=20 name=”number”/>

Msat: <input type = “text” size=20 name=”number”/>

Rsat: <input type=”text” size=20 name=”number”/>

portfolio: <input type=”text” size=20 name=”string”/>

al: <input type = “text” size=10 />

status: <input type=”text” size=20/>

<input type=”button” size=20 value = “onClick”>

<a href= “javascript” > </a>

</body>

</html>