C# (winform)—— 简易的成绩评定工具
(1)新建Windows窗体应用程序,实现根据输入的学生成绩,显示相应的等级:优,良,中,差,及格和不及格。
(2)首先我们使用Label,Button,TextBox对可视化界面进行布局,并修改相应的属性标题等相关信息。
(3)点击“评定等级”按钮,写入相应代码
int score;
string grade;
score = Convert.ToInt32(textBox1.Text);
if (score > 100)
grade = "输入错误!";
else if (score >= 90)
grade = "优秀!";
else if (score >= 80)
grade = "良好!";
else if (score >= 70)
grade = "中等!";
else if (score >= 60)
grade = "及格!";
else if (score >= 0)
grade = "不及格!";
else
grade = "输入错误!";
textBox2.Text = grade;
(4)实现的系统功能如下:
——————————————————————————————————————
第一次发布文章,嘿嘿嘿~
把这个简易的工具写出来一是为了以后回头看看自己走过的路,二是希望可以帮到一些在学他的同学,互帮互助,共同进步!