• 大小: 6.59MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-25
  • 语言: 其他
  • 标签: C#  代码  

资源简介

小学生数学测试系统是我做的课题设计,里面实现了测试的难易选择,类型选择,难易程度还包含年纪的选择。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MathTest
{
    public partial class ceshi : Form
    {
        public ceshi()
        {
            InitializeComponent();
        }
        public 
        
        string flag=““;//声明一个变量来储存学生选择题的信息
        double defen=0;
        int num = 2;//控制产生随机数的个数
        private void buttonnext_Click(object sender EventArgs e)
        {
            Random re = new Random();
            int sum=0;

           
           

            num1.Text = n1.ToString();
            num2.Text = n2.ToString();

            try
            {


                switch (yunsuan)
                {
                    case “+“:
                        {


                            sum = jiafa(n1 n2);



                            if (sum.ToString() == textBoxanswer.Text)//如果答案正确,rightanswer++;
                            {
                                label1.ForeColor = Color.Blue;
                                label1.Text = “正确“;
                                rightanswer++;

                            }
                            else
                            {
                                label1.ForeColor = Color.Red;
                                label1.Text = “错误“;

                            }

                            textBoxanswer.Text = ““;
                            answer++;//记录做题个数

                        }; break;
                    case “-“:
                        {




                            sum = jianfa(n1 n2);


                            if (sum.ToString() == textBoxanswer.Text)//如果答案正确,rightanswer++;
                            {
                                rightanswer++;
                                label1.ForeColor = Color.Blue;
                                label1.Text = “正确“;

                            }
                            else
                            {
                                label1.ForeColor = Color.Red;
                                label1.Text = “错误“;
                            }
                            textBoxanswer.Text = ““;
                            answer++;//记录做题个数

                        }; break;
                    case “*“:
                        {


                            sum = chengfa(n1 n2);


                            if (sum.ToString() == textBoxanswer.Text)//如果答案正确,rightanswer++;
                            {
                                rightanswer++;
                                label1.ForeColor = Color.Blue;
                                label1.Text = “正确“;
                            }
                            else
                            {
                                label1.ForeColor = Color.Red;
                           

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2012-07-09 16:54  MathTestsystem\
     目录           0  2012-07-09 16:54  MathTestsystem\MathTest\
     文件         866  2012-05-30 10:26  MathTestsystem\MathTest.sln
     文件       37376  2012-10-01 20:04  MathTestsystem\MathTest.suo
     文件          77  2012-05-26 10:44  MathTestsystem\MathTest\app.config
     目录           0  2012-07-09 16:54  MathTestsystem\MathTest\bin\
     目录           0  2012-07-09 16:54  MathTestsystem\MathTest\bin\Debug\
     文件     1690112  2012-06-10 11:55  MathTestsystem\MathTest\bin\Debug\WindowsForms8.exe
     文件          77  2012-05-26 10:44  MathTestsystem\MathTest\bin\Debug\WindowsForms8.exe.config
     文件      128512  2012-06-10 11:55  MathTestsystem\MathTest\bin\Debug\WindowsForms8.pdb
     文件       11600  2012-10-01 18:04  MathTestsystem\MathTest\bin\Debug\WindowsForms8.vshost.exe
     文件          77  2012-05-26 10:44  MathTestsystem\MathTest\bin\Debug\WindowsForms8.vshost.exe.config
     文件         490  2010-03-17 22:39  MathTestsystem\MathTest\bin\Debug\WindowsForms8.vshost.exe.manifest
     文件       77286  2012-06-10 11:55  MathTestsystem\MathTest\ceshi.cs
     文件        9509  2012-06-10 01:25  MathTestsystem\MathTest\ceshi.Designer.cs
     文件        5817  2012-06-10 01:25  MathTestsystem\MathTest\ceshi.resx
     文件        3373  2012-06-10 11:57  MathTestsystem\MathTest\ceshiselect.cs
     文件       12974  2012-06-10 11:57  MathTestsystem\MathTest\ceshiselect.Designer.cs
     文件        5817  2012-06-10 11:57  MathTestsystem\MathTest\ceshiselect.resx
     文件           1  2012-05-25 23:23  MathTestsystem\MathTest\ClassDiagram1.cd
     文件           1  2012-05-26 10:48  MathTestsystem\MathTest\ClassDiagram2.cd
     文件        6342  2012-10-01 20:08  MathTestsystem\MathTest\denglu.cs
     文件        5915  2012-06-09 18:46  MathTestsystem\MathTest\denglu.Designer.cs
     文件        5817  2012-06-09 18:46  MathTestsystem\MathTest\denglu.resx
     文件        7186  2012-06-10 11:46  MathTestsystem\MathTest\gerenxinxi.cs
     文件        4872  2012-06-10 11:11  MathTestsystem\MathTest\gerenxinxi.Designer.cs
     文件        5817  2012-06-10 11:11  MathTestsystem\MathTest\gerenxinxi.resx
     文件        6108  2012-06-09 18:46  MathTestsystem\MathTest\MathTest.csproj
     目录           0  2012-07-09 16:54  MathTestsystem\MathTest\obj\
     目录           0  2012-07-09 16:54  MathTestsystem\MathTest\obj\x86\
     目录           0  2012-07-09 16:54  MathTestsystem\MathTest\obj\x86\Debug\
............此处省略47个文件信息

评论

共有 条评论