zoukankan      html  css  js  c++  java
  • 编程实践62

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    
    namespace Achievement2
    {
        class Program
        {
            static void Main(string[] args)
            {
                double dblStuScore;
    
                Console.WriteLine("        学生成绩管理系统");
                Console.WriteLine("        (输入-1退出系统)");
    
                do
                {
                    Console.Write("\n请输入学生的成绩:");
                    dblStuScore = Convert.ToDouble(Console.ReadLine());
                    if (dblStuScore == -1)
                    {
                        break;
                    }
                    if (dblStuScore < 0 || dblStuScore > 100)
                    {
                        Console.WriteLine("你输入的成绩不合法,请重新输入!");
                    }
                    else
                    {
                        Console.WriteLine(chA(dblStuScore));   
                    }
                } while (true);
    
                Console.WriteLine("\n谢谢使用学生成绩管理系统!");
                Console.ReadKey();
            }
            public static string chA(double iA)
            {
                string strOutput;
                switch ((int)(iA / 10))
                {
                    case 10:
                    case 9:
                        strOutput = "优秀";
                        break;
                    case 8:
                        strOutput = "";
                        break;
                    case 7:
                        strOutput = "";
                        break;
                    case 6:
                        strOutput = "及格";
                        break;
                    default:
                        strOutput = "不及格";
                        break;
                }
               return "成绩等级:" + strOutput;
            }
        }
    }
  • 相关阅读:
    解决死锁四大方式
    Windows内存管理简介:
    排序算法优劣
    排序
    HTTPs
    http和https的异同
    HTTP协议
    FTP与TFTP
    tomcat热部署
    开发心得体会
  • 原文地址:https://www.cnblogs.com/Wzqa/p/2802706.html
Copyright © 2011-2022 走看看