In: Computer Science
University of IT is a new for profit college that aims to serve the growing need of trained IT professionals in the workplace. To expand, it recently announced a large grant from several of the large technology companies that it plans to use to provide scholarships.
There are two kinds of scholarships: Presidential(full tuition scholarship) and Ambassador(half tuition scholarship). To get a Presidential scholarship, a student must have an A, A-, or B+ Grade Point average and an ACT score of 28 or more. To get an Ambassador Scholarship, a student must have an A, A-, B+, B or B- Grade Point Average OR an ACT score of 24 or more. A final piece of data that is to be collected is whether the student has financial need (Yes/No)
Create a program that allows for input of a GPA using letters, A, A-, B+,B, B-, C+,C,C- only. Optionally you can add a "Lower than C" category. A student can only have one of these grade letter GPA values. Also allow input of an ACT score. Based on the criteria, analyze the GPA and the ACT score and determine if an individual should get a scholarship. Upon completion of determining scholarship eligibility, the program should display on screen one of three results:
The financial need data is not used in determining the eligibility but will be used for other purposes.
Make sure the ACT score is a positive, numeric value. When the program first loads, make sure no default values are chosen. Provide a clear function so that the GPA and ACT score and financial need data are cleared out and another students data can be entered. Provide an Exit function as well so that the user doesn't have to cancel the screen in the upper right corner to exit the program. The name of the program to appear on the screen is "Scholarship Eligibility Application" (without the quotes).
Within the program, comment sections of the code to indicate what is happening. Use Windows naming standards for both variables and objects including the form and application.
- Code must be written in C# in visual studios
Hi, I have coded the solution and if you need any further assistance do comment and if you like do leave positive feedback and a thumbs up.
Code
using System;
class Scholarship {
static void Main() {
Console.WriteLine(" Scholarship Eligibility Application\n");
string GPA;//it takes grade input
int ACT;//it takes ACT value from user
string financial_assist;//for financial assistance needed or not.
Console.WriteLine("Please Enter your GPA Score: ");
GPA = Console.ReadLine();
Console.WriteLine("Please Enter your valid positive and numeric value: ");
ACT = Convert.ToInt32(Console.ReadLine());
int len = GPA.Length;
Console.WriteLine("Do you need financial need ");
financial_assist = Console.ReadLine();
//so basically to make it simple what i am doing is like taking input in string and after that see what is the length pf it
// if lenght is 1 ie input given is A,B,C an dif input is like A-,B-,.. then its two caracter and i am getting them
//in two characters first and second and then apply if-else to find answer.
char first;
char second='D';
if(len == 1)
first = GPA[0];
else{
first = GPA[0];
second = GPA[1];
}
if(((first == 'A') || (first == 'A' && second =='-') || (first == 'B' && second =='+' )) && (ACT >= 28)){
Console.WriteLine("Presidential Scholarship Awarded ");
}
else if(((first == 'A' && second=='-') || (first == 'B' && second =='+' ) || (first == 'B' && second =='-') || (first == 'B')) && ACT >= 24){
Console.WriteLine("Ambassador Scholarship Awarded ");
}
else
Console.WriteLine("No Scholarship Available Based On Criteria ");
Console.Clear();
System.Environment.Exit(0);
}
}