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 (for example, 75). 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".
using System;
namespace Admission
{
class Program
{
public static void Main(string[] args)
{
float avg;
int score;
Console.WriteLine("Grade point average: ");
avg = float.Parse(Console.ReadLine(), System.Globalization.CultureInfo.InvariantCulture); //decimal mark is "."
Console.WriteLine("Admission test score: ");
score = int.Parse(Console.ReadLine());
if ((avg >= 3) && (score >= 60) || (avg < 3) && (score >= 80))
Console.Write("Accept");
else
Console.Write("Reject");
Console.ReadKey(true);
}
}
}
Comments
Leave a comment