I need the answers in c# language not in any othere languages! thank you! 7.40 i
ID: 639790 • Letter: I
Question
I need the answers in c# language not in any othere languages! thank you!
7.40 is the question.
(Computer-Assisted Instruction) The use of computers in education is referred to as computer-assisted
instruction (CAI). Write a program that will help an elementary school student learn
multiplication. Use a
Random object to produce two positive one-digit integers. The program should
then prompt the user with a question, such as
How much is 6 times 7?
The student then inputs the answer. Next, the program checks the student
Explanation / Answer
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();
}
}
}
}