public static void AddGradeCommand(string command) { var parts = command.Split(' '); if (parts.Length != 3) { Console.WriteLine("Command not valid, AddGrade requires a name and score."); return; } var name = parts[1]; var score = Double.Parse(parts[2]); GradeBook.AddGrade(name, score); Console.WriteLine("Added a score of {0} to {1}'s grades", score, name); }
public static void AddGradeCommand(string command) { var parts = command.Split(' '); if (parts.Length != 3) { Console.WriteLine("Command not valid, AddGrade requires a student name and score."); return; } var studentName = parts[1]; var grade = Double.Parse(parts[2]); GradeBook.AddGrade(studentName, grade); Console.WriteLine($"Added a grade of {grade} to {studentName}'s grades"); }