求VB“小学数学计算题练习”的代码。 有重谢。。高手帮帮我吧。

随机生成10道10以内的加减法乘除的数学计算题。设计界面。可以根据拥护的计算结果,判断对错。。并平定成绩。。。。 谢谢告诉啦。

是C#编写的,如果你会VB,那看这个应该不难理解了! è¿™é‡Œåªæœ‰+ -功能及正确率的算法!

你拿去参考吧!

private int num1;

        private int num2;

        private int num3;

        private int right = 0;

        private int result;

        private int opr;

        private int count = 0;

        public void func()

        {

            Random random = new Random();

            num1 = random.Next(10, 100);

            num2 = random.Next(10, 100);

            opr = random.Next(0, 2);

            if (opr == 0)               //+

            {

                result = num1 + num2;

                label1.Text = num1.ToString() + " + " + num2.ToString() + " =";

            }

            else

            {

                if (num1 < num2)

                {

                    num3 = num1;

                    num1 = num2;

                    num2 = num3;

                }

                result = num1 - num2;

                label1.Text = num1.ToString() + " - " + num2.ToString() + " =";

            }

            count++;

            textBox1.Text = "";            //清空答题文本框

        }

        private void Form1_Load(object sender, EventArgs e)

        {

            count = 0;

            right = 0;

            func();

            label2.Text = "共" + count + "道题,正确率为:" + "1";

        }

        private void textBox1_KeyPress(object sender, KeyPressEventArgs e)

        {

            string Item;

            double k;

            if (e.KeyChar == 13)

            {

                try

                {

                    if (Convert.ToInt16(textBox1.Text.ToString()) == result)

                    {

                        Item = label1.Text + textBox1.Text.ToString().Trim() + "  âˆš";

                        //listBox1.Text = listBox1.Text + label1.Text.ToString();

                        right++;

                    }

                    else

                    {

                        Item = label1.Text + textBox1.Text.ToString().Trim() + "  â•³ " + " æ­£ç¡®ç­”案为" + result ;

                    }

                    this.listBox1.Items.Add(Item);        //题目添加到列表框

                    this.textBox1.Text = "";

                    k = ((double)right / count) * 100;

                    label2.Text = "共" + count + "道题,正确率为:" + k.ToString() + "%";

                    func();

                }

                catch (Exception )

                {

                    

                }

            }

        }

温馨提示:答案为网友推荐,仅供参考
第1个回答  2010-06-12
这应该不难啊
第2个回答  2010-06-12
这个不是很难的,在这里也不好回答,因为要做示例.你最好找一个论坛问问.
第3个回答  2010-06-12
我这有作好的小学数学竖式计算练习。vb6.0的。如果需要,联系我。功能强大多了。可以选择各种出题范围。
或者可以到以下链接拍com/item/72e01b380a7647ebc5db0165

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网