175k views
5 votes
Write a program named Admission for a college’s admissions office. The user enters a numeric high school grade point average (for example, 3.2) and an admission test score. Display the message Accept if the student meets either of the following requirements: A grade point average of 3.0 or higher, and an admission test score of at least 60 A grade point average of less than 3.0, and an admission test score of at least 80 If the student does not meet either of the qualification criteria, display Reject.

User Gearhead
by
7.4k points

2 Answers

3 votes

Below is the code for the program named "Admission" for a college's admissions office.

Python

def admission(gpa, test_score):

if gpa >= 3.0 and test_score >= 60:

result = "Accept"

elif gpa < 3.0 and test_score >= 80:

result = "Accept"

else:

result = "Reject"

return result

gpa = float(input("Enter your GPA: "))

test_score = int(input("Enter your admission test score: "))

admission_status = admission(gpa, test_score)

print("Admission Status:", admission_status)

So, the above code first defines a function admission() that takes the student's GPA and admission test score as input and returns their admission status.

Also, It then prompts the user to enter their GPA and admission test score, stores the values in variables, and calls the admission() function to determine the admission status. then, it prints the admission status message.

User Nishanth Sreedhara
by
7.7k points
5 votes

Answer:

C++ Example

Step-by-step explanation:

Code

#include<iostream> //for input and output

#include<string>

using namespace std;

int main()

{

float gpa;

int testScore;

cout<<"Enter GPA:";

cin>>gpa;

cout<<"Enter Test Score: ";

cin>>testScore;

if((gpa>=3.2 && testScore>=60) || (gpa>=3.0 && testScore>=80)){

cout<<"Accept";

}

else{

cout<<"Reject";

}

}

Code Explanation

First we need to define a float GPA variable and integer test score variable.

Then prompt user to enter both value.

Once user enter the values then we added if statement to check both accepting criteria. If criteria matches then show Accept otherwise else part will execute and show Reject.

Output

Case 1:

Enter GPA:3.0

Enter Test Score: 80

Accept

Case 2:

Enter GPA:3.2

Enter Test Score: 60

Accept

Case 3:

Enter GPA:3.2

Enter Test Score: 59

Reject

User Preahkumpii
by
8.1k points