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

In c# You have been asked to design a program that will allow a teacher to calcu

ID: 3665112 • Letter: I

Question

In c# You have been asked to design a program that will allow a teacher to calculate the percentage and the final grade for students in a class. The program will prompt the teacher to enter the student’s first and last name and the number of points the student received. The program will only accept scores between 0 and 1,000 points (including 0 and 1,000), with 1,000 points being the maximum number of points. If the input value within the valid range, the program will display a “good score” message; otherwise, the program will display an error message and then terminate the program. The program will then calculate the score percentage and then determine the grade based on the percentage using the following grade criteria.

Score Percent    Range

Grade

90—100

A

80—89

B

70—79

C

60—69

D

0—59

F

The program will then display the student’s first name, last name, number of points, calculated percentage, and final grade.

The program will have an initial prompt informing the user of the program’s purpose, along with a program termination message

Score Percent    Range

Grade

90—100

A

80—89

B

70—79

C

60—69

D

0—59

F

Explanation / Answer

//C# PROGRAM TO CHECK THE GRADE OF STUDENT

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace console8
{
class Program
{
static void Main(string[] args)
{

//read the first name ,and last name
Console.WriteLine("Enter the students first name ");
string fname = Console.ReadLine();
Console.WriteLine("Enter the students last name ");
string lname = Console.ReadLine();
//read the points which he achieved
Console.WriteLine("Enter the number of points received ");
double points = Convert.ToDouble( Console.ReadLine());
//check whether the entered point is valid or not
if (points < 1000 && points > 0)
{
Console.WriteLine("Good score ");
double maxpoints = 1000;
//calculation of percentage
double studpoint = (points / maxpoints) * 100;
//checking to which grade the student belongs to
if (studpoint >= 90 && studpoint < 100)
{
Console.WriteLine("Grade A ");
}
else if (studpoint < 90 && studpoint >= 80)
{
Console.WriteLine("Grade B ");
}
else if (studpoint < 80 && studpoint >= 70)
{
Console.WriteLine("Grade C ");
}
else if (studpoint < 70 && studpoint >= 60)
{
Console.WriteLine("Grade D ");
}
else
Console.WriteLine("Grade F ");
}

  
else
{
Console.WriteLine("ERROR!!!Please try again with valid points.points should be less than 1000 ");
}
Console.ReadLine();
}
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote