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
Serhud [2]
3 years ago
13

Write a program that deliberately contains an endless or infinite while loop. The loop should generate multiplication questions

with single digit random integers. Users can answer the questions and get immediate feedback. After each question, the user should be able to stop the questions and get an overall result. See Example Output.
Computers and Technology
1 answer:
Westkost [7]3 years ago
3 0

Answer:

The Java code is given below with appropriate variable names for better understanding

Explanation:

import java.util.Random;

import java.util.Scanner;

public class MultiplicationQuestions {

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       Random rand = new Random();

       int n1, n2, result, total = 0, correct = 0;

       char ch = 'y';

       while(ch == 'y'){

           n1 = 1 + rand.nextInt(9);

           n2 = 1 + rand.nextInt(9);

           System.out.print("What is "+n1+" * "+n2+" ? ");

           result = scan.nextInt();

           if(result==n1*n2){

               System.out.println("Correct. Nice work!");

               correct++;

           }

           else{

               System.out.println("Incorrect. The product is "+(n1*n2));

           }

           System.out.print("Want more questions y or n ? ");

           ch = scan.next().charAt(0);

           total++;

       }

       System.out.println("You scored "+correct+" out of "+total);

   }

}

You might be interested in
Why would students most likely need to collect data? Check all that apply
n200080 [17]
Well I would think all of them in some way. For the first one, students need to collect data (whether it’s mathematical, scientific, etc.) to answer a question. For the second one, they may need to know how much money is in there bank account or they may need to calculate a sale to order the item. For the third one, they may need statistical data to support a position. For the last one, a student could use technological data to be able to solve their problem sorting documents.
5 0
3 years ago
Read 2 more answers
1. Which of the following is NOT an example of systems software? (Points : 1)
vladimir2022 [97]
The answer is "operating systems" brcause you need that that to use the rest
' 
4 0
2 years ago
Read 2 more answers
A hardware component that keeps data and information when the device is not powered is called a ____ device.
serious [3.7K]

It should be noted that the hardware component that keeps data and information when the device is not powered is called a storage device.

This device can be permanent or temporary storage device.

<h3>What is a storage device?</h3>

Storage device can be regarded as the device that store data.

There are different storage devices for the computer system, they includes;

  • Optical Storage Devices.
  • External HDDs
  • Random Access Memory
  • Flash memory devices.
  • Floppy Disks.

Learn more about storage device at ;

brainly.com/question/21283135

5 0
2 years ago
In his work for a new company, Byron found a flower material that he could use to manufacture dresses. In his career, Byron is m
bekas [8.4K]

I guess the correct answer is plant system pathway

Thе plant systеms pathway includеs οccupatiοns rеlatеd tο grοwing fοοd, fееd, and fibеr crοps, and thе study οf plantsand thеir grοwth tο hеlp prοducеrs mееt cοnsumеr dеmand whilе cοnsеrving natural rеsοurcеs and maintaining thе еnvirοnmеnt.

In his work for a new company, Byron found a flower material that he could use to manufacture dresses. In his career, Byron is most likely focused on the plant system pathway.


5 0
3 years ago
Read 2 more answers
How can chess computers be programmed so that it can be so accurately adjusted to a skill level ranging from a beginner to a gra
Elis [28]
They are artificially intelligent. They watch thousands of hours of videos of the game they are going to play. After they learn, they challenge themselves against themselves and save all the moves it used that time, they play another game against the saved game and if they best it then they save the new and repeat. I am not sure about this because I am just a 15 yr old but the early ones brute forced the game and one. Brute Forcing is a way to try out every possible move and pick the most like to succeed or the most efficient one, brute force is also used in hacking or cracking passwords that have something in common. Like let's say ur password is Jakeis35. I would make a list that would be:
Jake
jake
Is
is
35
34

and with a software it will put together every possible pair and will stop when it matches the password on the server or if the password let it login.
5 0
2 years ago
Other questions:
  • Create a division formula.
    9·1 answer
  • 2. Fabulously Fit offers memberships for
    9·1 answer
  • Electric Bill Problem 3.0 (20 Points) What is the total cost of using the following at /kWh? a. 1600 W air conditioner for 6h b.
    11·1 answer
  • ___________is a security strategy that applies multiple layers of defense because there is an assumption that any single protect
    12·1 answer
  • An OS X backup utility that automatically backs up files to a dedicated drive that is always available when the computer is turn
    6·1 answer
  • Just as arrays can only have a, set at the time the array is declared, a parameter list also can only have a fixed number of ele
    5·1 answer
  • Is backing up computer files done on the hard drive?
    14·2 answers
  • What is modularity? Help asap
    9·1 answer
  • You are asked to check your company’s configurations to determine if any filters should be built to stop certain ICMPv6 traffic.
    9·1 answer
  • PLEASE HELP
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!