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

Microsoft Visual C# 2012: An introduction to object-oriented programming Ch.4 Qu

ID: 3675358 • Letter: M

Question

Microsoft Visual C# 2012: An introduction to object-oriented programming Ch.4 Question #4

A). Write a console-based application 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:

1. A grade point average of 3.0 or higher and as admission test score of at least 60

2. A grade point average of less than 3.0 and an admission test score of at least 80

B). If the student does not meet either of the qualification criteria, display "Reject".

Create a GUI application named AdmissionGUI for the college admissions office described in 4a.

Explanation / Answer

using System; namespace _155119 { class Program { static void Main(string [] args) { string stringUserInPut1, stringUserInPut2; Applicant a = new Applicant (); Console .WriteLine("Please enter your point grade average" ); stringUserInPut1 = Console .ReadLine(); a.gpa = Convert .ToDouble(stringUserInPut1); Console .WriteLine("Please enter your admission test score" ); stringUserInPut2 = Console .ReadLine(); a.score = Convert .ToDouble(stringUserInPut2); if (a.IsAdmitted()) Console .WriteLine("You are accepted, congratulations!" ); else Console .WriteLine(" Sorry, but you do not meet requirements " ); } } class Applicant { const double minimumgpa = 3.0; const double minimumscore = 60; const double superscore = 80; public double gpa, score; public bool IsAdmitted() { if (score > superscore) return true ; if (gpa >= minimumgpa && score > minimumscore) return true ; return false ; } } }