private static double[] rangeLimit = {  60.0, 75.0, 85.0, 95.0,100.0 };
private static string[] grade = {"不合格", "合乎要求", "良好", "优秀" ,"卓越"};
private static readonly int maxLevel = grade.Length - 1;
public static string CalculateGrade(double score)
{
   int level = 0;
   while (level <= maxLevel)
    {
          if (score < rangeLimit[level])
           {
               return grade[level];
           }
          else

         {

             level++;

          }
    }
    return grade[maxLevel];
}

相关文章:

  • 2022-12-23
  • 2021-09-29
  • 2022-01-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-20
  • 2022-01-08
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-04
  • 2021-07-04
  • 2022-02-16
  • 2022-12-23
  • 2021-05-27
  • 2021-12-15
相关资源
相似解决方案