1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Yanka [14]
3 years ago
9

The use of computers in education is referred to as computer-assisted instruction (CAI). Write a program that will help an eleme

ntary-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 asHow much is 6 times 7?The student then inputs the answer. Next, the program checks the student’s answer. If it is correct, display the message "Very good!" and ask another multiplication question. If the answer is wrong, display the message "No. Please try again." and let the student try the same question repeatedly until the student gets it right. A separate method should be used to generate each new question. This method should be called once when the app begins execution and each time the user answers the question correctly.here is the code that I have but for some reason, I keep getting the same question (0 * 0) can you help me figure out what I did wrong or do this problem tnxusing System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace P739{class P739{private static Random random = new Random();private static int randomNumber1 = 0;private static int randomNuber2 = 0;private static int multiplicationResult = 0;private static bool isNeedToShowQuestionAgain = false; private static int RandomNumber (int min, int max){return random.Next(min,max);}private static void GenerateQuestion (bool isNeedToShowQuestion){if (!isNeedToShowQuestionAgain)PrintQuestion(); }private static void PrintQuestion(){Console.WriteLine(string.Format("How much is {0} times {1}?", randomNumber1, randomNuber2));} static void Main(){while (true){int userInput=0;GenerateQuestion(isNeedToShowQuestionAgain);try{userInput = Convert.ToInt32(Console.ReadLine());}catch { }if (userInput == multiplicationResult){Console.WriteLine("very good! your answer is correct.");isNeedToShowQuestionAgain = false;}else{Console.WriteLine("No.Please try again.");isNeedToShowQuestionAgain = true;}}}}}
Computers and Technology
1 answer:
mash [69]3 years ago
3 0

Answer:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace P739 {

class P739 {

   private static Random random = new Random();

   private static int randomNumber1 = 0;

   private static int randomNuber2 = 0;

   private static int multiplicationResult = 0;

   private static bool isNeedToShowQuestionAgain = false;

   // Methods

   private static int RandomNumber (int min, int max) {

       return random.Next(min,max);

   }

   private static void GenerateQuestion (bool isNeedToShowQuestion) {

       if (!isNeedToShowQuestionAgain)  {

           randomNumber1 = RandomNumber(0, 9);

           randomNumber2 = RandomNumber(0, 9);

       }

       PrintQuestion();

   }

   private static void PrintQuestion() {

       Console.WriteLine(string.Format("How much is {0} times {1}?", randomNumber1, randomNuber2));

   }

// Main

static void Main() {

   while (true) {

       int userInput=0;

       GenerateQuestion(isNeedToShowQuestionAgain);

       try {

           userInput = Convert.ToInt32(Console.ReadLine());

       }

       catch {  

       }

       if (userInput == multiplicationResult) {

           Console.WriteLine("very good! your answer is correct.");

           isNeedToShowQuestionAgain = false;

       }

       else {

           Console.WriteLine("No.Please try again.");

           isNeedToShowQuestionAgain = true;

       }

   }

}

}

}

Explanation:

The problem was in your GenerateQuestion method. You weren't generating new random numbers and setting them to the two random number variables. Hence the same original random numbers were kept.

Also there was a bug in GenerateQuestion method where PrintQuestion() was not being called if isNeedToShowQuestionAgain = true.

You might be interested in
What is an example of an intelligent automation solution that makes use of artificial intelligence?.
mafiozo [28]

Copying text from a web browser is an example of an intelligent automation solution that uses artificial intelligence.

<h3>What is  intelligent automation solution?</h3>

The intelligent automation solution is the combination of new technologies such as artificial intelligence and robotic automations that helps to enhance and enable the program to learn, interpret, and respond by itself.

The complete questions is as follows:

  1. signing-in to various desktop applications
  2. filling out forms with basic contact information
  3. copying text from a web browser
  4. recognizing and interpreting natural language

The best example for  intelligent automation solution is copying text from web browser as the AI interprets the command and the robotic automation will provide its output.

Therefore, option 3. is correct.

Learn more about intelligent automation solution, here:

brainly.com/question/24977867

#SPJ1

7 0
2 years ago
Brainliest
alekssr [168]

Answer:

fair credit reporting act

6 0
3 years ago
A(n) ________ is usually a live broadcast of audio or video content. Select one: A. instant message B. webcast C. podcast D. wik
navik [9.2K]

Answer: B webcast

Explanation:

A webcast is a technology that allows the live broadcast of an audio or video event on the Internet. It is also known as Web lecture, virtual meeting, etc. The major advantage is that it gives room for an event to have a larger reach. Webcast participation can be through PC, smart phones, tablets and other devices with quality Internet access.

7 0
4 years ago
Read 2 more answers
Mainframe computers have several CPUs, have very fast processor speeds, can supporting multiple operating systems and have huge
Marrrta [24]

Answer:

True.

Explanation:

Mainframe computers were developed and introduced in the early 1950s.

Mainframe computers have several CPUs, have very fast processor speeds, can supporting multiple operating systems and have huge amounts of storage capacity. As a result, mainframe computers are mostly or commonly used by large companies, business firms or governmental institutions for performing various complex tasks such as census, financial transactions, e-commerce, data sequencing, enterprise resource planning, etc.

7 0
3 years ago
The student cd contains a file named random.txt. This file contains a long list of random numbers. copy the file to your hard dr
Minchanka [31]

Answer:rick roll

Explanation:

trrrrrrrrrrwgd

8 0
3 years ago
Other questions:
  • Candace opened an email from a person she didn't know and clicked on a pop-up in the email that installed a virus on her compute
    8·2 answers
  • When typing in a cell, hitting Tab will bring which result?
    12·2 answers
  • What is an icon or animation used to represent a participant in an internet chat referred to as
    15·2 answers
  • When activated, an Excel object has all the features of an Excel
    8·2 answers
  • Rapid development programming languages eliminate the possibility of having bugs in code. True or False
    8·1 answer
  • Case-Based Critical Thinking Questions​Case 1: Tony’s Pizza &amp; Pasta​Tony’s Pizza &amp; Pasta restaurant uses an application
    9·1 answer
  • Payroll deductions are the same for all employees. True False
    12·1 answer
  • Kurtz &amp; Kemeny created an easy-to-learn programming language called?
    15·1 answer
  • Kerry is debugging a program. She identifies a line of code to begin execution and a line of code to end execution so that she i
    11·1 answer
  • Five jobs arrive nearly simultaneously for processing and their estimated CPU cycles are, respectively: Job A = 2 ms, Job B = 12
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!