Forum guidelines
  • Home
  • »
  • C# Language
  • »
  • help an elementary school student learn multiplication
AuthorQuestion
help an elementary school student learn multiplication
Posted on: 10 Dec 2012
Computers are playing an increasing role in education. Write a program that will help an elementary school student learn multiplication.
Use the Next method from an object of type Random to produce two positive one-digit integers.
It should display a question in the status bar, such as How much is 6 times 7? The student should then type the answer , Your program should check the student's answer. If it is correct,output the string "Very good!", then ask another multiplication question. If the answer is wrong, output the string "No. Please try again.", then let the student try the same question again until the student finally gets it right. A separate method should be used to generate each new question. This method should be called once when the program begins execution and each time the user answers the question correctly.

AuthorReply
nallya
  • 0
  • 2
accepted
Re: help an elementary school student learn multiplication
Posted on: 11 Dec 2012   Accepted Answer
windowsformsapplication2.rar Hoe this will help you:

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 ListDemo
{
    public partial class Form3 : Form
    {
        int temp;
        int temp1;
        int CalculatedResult;
        int inputResult;
        public Form3()
        {
            InitializeComponent();
            GenarateRandomNo();
        }

        public void GenarateRandomNo()
        {
            Random random = new Random();
            temp = random.Next(0, 10);
            temp1 = random.Next(0, 10);
            label3.Text = "What is the Multiplication of  " + temp + "  *" +  temp1 + " ?";
        }

        private void button1_Click(object sender, EventArgs e)
        {
            CalculatedResult = temp * temp1;
            inputResult = Convert.ToInt32(textBox1.Text);
            if (CalculatedResult == inputResult)
            {
                label4.Text = "Very Good!";
                GenarateRandomNo();
                textBox1.Text = "";
                textBox1.Focus();
            }
            else
            {
                label4.Text = "No. Please try again.";
                textBox1.Text = "";
                textBox1.Focus();
            }
        }
    }
}


SPONSORED BY

Custom Software Development
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.