代码如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace demo
{
public partial class Hello : Form
{
public Hello()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e) // 窗体载入
{
this.Text = "判断分数等级"; // 设置标题栏
this.Width = 600; // 设置宽度
this.Height = 300; // 设置高度
}
private void btnOK_Click(object sender, EventArgs e) // 执行求开平方
{
int inNum = int.Parse(textBox1.Text); // 读取输入字符串解析为数字
Judge j = new Judge(); // 创建一个Judge对象
switch (j.Level(inNum)) // j.Level(inNum)调用类的方法获取返回ABCD
{
case "A":