// Directions: Practice #7-2: Grade Selector
// 1) Add 5 double constants for the following values: 90, 80, 70, 60 representing grade ranges.
// 2) Create a double variable and assign it a grade.
// 3) Create a string varible for the grade.
// 2) Create an if, elseif, elseif, elseif, else structure to determine the letter grade of the score.
// a) Greater than or equal to 90, assign an A to the grade variable.
// a) Greater than or equal to 80 and less than 90, assign an B to the grade variable.
// a) Greater than or equal to 70 and less than 80, assign an C to the grade variable.
// a) Greater than or equal to 60 and less than 70, assign an D to the grade variable.
// ) Assign an F to the grade variable.
// 5) Output appropriate message to the screen. "A score of 93 is an A."
// 7) Submit your dotnetfiddle link in Blackboard.
using System;
public class Program
{
public static void Main()
//Add 5 double constants for the following values: 90, 80, 70, 60 representing grade ranges.
const double GRADE = 90;
//const double GRADE = 80;
//const double GRADE = 70;
//const double GRADE = 60;
double dblScore = 93;
string strGRADE_RANGER;
if(dblScore >= GRADE)
// Greater than or equal to 90, assign an A to the grade variable.
strGRADE_RANGER = "A";
}
else if (dblScore >= GRADE)
// Greater than or equal to 80 and less than 90, assign an B to the grade variable.
strGRADE_RANGER = "B";
// Greater than or equal to 70 and less than 80, assign an C to the grade variable.
strGRADE_RANGER = "C";
// Greater than or equal to 60 and less than 70, assign an D to the grade variable.
strGRADE_RANGER = "D";
else
// Assign an F to the grade variable.
strGRADE_RANGER = "F";
Console.WriteLine("A score of " + dblScore + " is an " + strGRADE_RANGER + ".");