C# classes referencing to get letter grade
I have two program one name is program.cs and other is grade.cs ( this one has my methods in it) I'm trying to have program.cs reference grade.cs to show the grade letter. I was able to have my code show the grade percent but I'm also trying to have it show the actual letter grade next to the grade percent. Below is my code for the grade percent and the letter grade I'm unsure about referencing the letter grade because it is a double and I want to use percent in my program.cs to tally up the total for quizzes, tests, & homeworkProgram.CS
Console.WriteLine("Exam = " + myExam.GetGradePercent() + "%");
Grade.CS
public double GetGradePercent()
{
double totalEarnedPoints = 0; //Start with zero
//Add all elements of the array to total
for (int i = 0; i < scoresEntered; i++)
{
totalEarnedPoints += earnedScores[i];
}
//Return grade percentage by dividing earned points by total points
return totalEarnedPoints / pointTotal;
}
public string GetLetterGrade(double percentage)
{
//Incoming parameter will be in decimal format. Example 90% will be 0.90
percentage *= 100; //Multiply incoming percentage by 100 to move decimal point scaling number from 0 to 100
if (percentage >= 97.0)
{
return "A+";
}