Beginner – Assistance with using multiple methods

Hello. I've been trying to figure out how to pass a double into a method from the Main method, check the information in that double in a separate method, and depending what that number is, return a character. I know there are probably easier ways to do this, but in this case I'm more just trying to understand why this isn't working. Any help would be very much appreciated. I'll post my code below:

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication9 { class Program { static void Main(string[] args) { Console.Write("Enter the number you received for a grade: "); string stringGrade = Console.ReadLine(); double Grade = Convert.ToDouble(stringGrade); double AverageGrade = DetermineGradeAverage(Grade); Console.WriteLine("Your Final Grade is: " +AverageGrade); } public static double DetermineGradeAverage(double Grade) { if (Grade < 59) return 'F'; else if (Grade >= 60 && Grade <= 69) return 'D'; else if (Grade >= 70 && Grade <= 79) return 'C'; else if (Grade >= 80 && Grade <= 89) return 'D'; else if (Grade >= 90 && Grade <= 100) return 'A'; 

by Servatose via /r/csharp

Leave a Reply