嗨,有人可以帮助我在我的程序中它包含以下错误:在第 (3,26) 行中,它在第 (5,22) 行中显示“{预期”,在第 (5,22) 行中显示“{预期”,最后在第 (5,22) 行中它显示“无效的令牌';' 在类、结构或接口成员声明中”。
我真的无法确定如何修复错误,因为我刚开始编写 c#。任何帮助将不胜感激!谢谢!
using System;
namespace GradeEvaluation;
{
public class Program;
{
public static void Main(string[] args)
{
string name;
int grade, finalGrade;
Console.WriteLine("What is your name: ");
name = Console.ReadLine();
Console.WriteLine("What is your final grade: ");
finalGrade = Convert.ToDouble(Console.ReadLine());
if(finalGrade >= 0 && finalGrade <= 59.9)
Console.WriteLine("{0} Your final transmuted grade is 5", name);
else if(finalGrade >= 60 && finalGrade <= 63.99)
Console.WriteLine("{0} Your final transmuted grade is 3", name);
else if(finalGrade >= 64 && finalGrade <= 67.99)
Console.WriteLine("{0} Your final transmuted grade is 2.75", name);
else if(finalGrade >= 68 && finalGrade <= 71.99)
Console.WriteLine("{0} Your final transmuted grade is 2.5", name);
else if(finalGrade >= 72 && finalGrade <= 75.99)
Console.WriteLine("{0} Your final transmuted grade is 2.25", name);
else if(finalGrade >= 76 && finalGrade <= 79.99)
Console.WriteLine("{0} Your final transmuted grade is 2", name);
else if(finalGrade >= 80 && finalGrade <= 83.99)
Console.WriteLine("{0} Your final transmuted grade is 1.75", name);
else if(finalGrade >= 84 && finalGrade <= 87.99)
Console.WriteLine("{0} Your final transmuted grade is 1.5", name);
else if(finalGrade >= 88 && finalGrade <= 91.99)
Console.WriteLine("{0} Your final transmuted grade is 1.25", name);
else if(finalGrade >= 92 && finalGrade <= 100)
Console.WriteLine("{0} Your final transmuted grade is 1", name);
}
}
}