This is For C Sharp ! i need help to write an application that calculates a stud
ID: 3676150 • Letter: T
Question
This is For C Sharp! i need help to write an application that calculates a student’s GPA on a 4.0 scale. Grade point average (GPA) is calculated by dividing the total amount of grade points earned by the total amount of credit hours attempted. For each hour, an A receives 4 grade points, a B receives 3 grade points, a C receives 2 grade points, and a D receives 1 grade point. by allowing the user to input any number of courses and associated grades And displaying the number of hours earned and the GPA.
Explanation / Answer
Answer:
using System;
internal class kl
{
public static void Main(string[] args)
{
Scanner input = new Scanner(System.in);
Console.WriteLine("Enter number of courses:");
int course_count = input.Next();
double grade_a = 4.0;
double grade_b = 3.0;
double grade_c = 2.0;
double grade_d = 1.0;
double total_grade_a = (course_count) * (grade_a);
double total_grade_b = (course_count) * (grade_b);
double total_grade_c = (course_count) * (grade_c);
double total_grade_d = (course_count) * (grade_d);
double gpa_a = total_grade_a / course_count;
double gpa_b = total_grade_b / course_count;
double gpa_c = total_grade_c / course_count;
double gpa_d = total_grade_d / course_count;
Console.WriteLine("The grading of A is" + gpa_a);
Console.WriteLine("The grading of B is" + gpa_b);
Console.WriteLine("The grading of C is" + gpa_c);
Console.WriteLine("The grading of D is" + gpa_d);
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.