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
For what specific purpose is the TM9400 P25 Mobile designed? What is the benefit of having a mobile communications device that a
Sonja [21]

Answer:

The specific purpose for the design of the TM9400 P25 Mobile is its use for efficient communication with other emergency-handling jurisdictions, especially in challenging environments.

When a law enforcement officer requires a dedicated mobile network for communication in emergency situations, the TM9400 P25 Mobile comes handy.  It enables the officer to communicate under multiple operational modes from remote locations.

Encryption, together with its high quality audio and rugged build, ensures the durability of the TM9400 P25 Mobile.

The ability to communicate from many places, embedded into its interoperability, allows different law enforcement jurisdictions to seamlessly exchange intelligence.  It also has remote network management features, which enhance its spectral efficiency and effectiveness.

Explanation:

The TM9400 P25 Mobile is a high-performance, flexible, and robust radio specially designed for emergency situations. It is widely used by law enforcement officers to communicate with others from remote locations.

3 0
3 years ago
When should you stop where you are, drop to the
Vedmedyk [2.9K]

Answer:

A . if you burn a stump because if u roll over the fire will have a 90% chance of going out

7 0
3 years ago
Write a program to generate the 1,8,27,64,125,226,343,512,729,1000 series.​
ehidna [41]

Answer:

class series

{

public static void[]

main[string args[]]

{

into, I, n=4;

for(i=1;i<=n;i++)

{

d=i*i*i;

system. out. print(d+",");

}

}

}

Explanation:

java?

4 0
3 years ago
What is the difference between software and operating system software?
Basile [38]

Answer:

System software is the software that manages the resources and allows a user to interact with the system. On the other hand, an operating system collects programs that coordinate all activities among computer hardware devices.

4 0
3 years ago
One type of CAPTCHA is ________. a rootkit virus the wavy hard-to-read letter and number sequence that you type to prove that yo
sergejj [24]
<h2>password method</h2>

Explanation:

Rootkit virus is one type of virus which is hidden about its existence and tries to affect the maximum number of system.

Password method: This is a graphical method to identify the text hidden in the signature and confirming that it is not a robot or any other system to protect the system from hacking. This would be really hard-to-read and thus ensures safety.

Antivirus software: This is a system to protect the system, when the virus tries to attack the system. An indication will be given through the software to the user.

4 0
3 years ago
Other questions:
  • Discuss the important basic building blocks required to create a web page in HTML/XHTML. Discuss how to place CSS rules within y
    15·1 answer
  • True or False? In cloud computing, the term "Measured service" refers to a billing model in which gaining access to resources do
    12·1 answer
  • The overall purpose of CSS is to modify the way web pages look without modifying the underlying HTML code. way tables render in
    12·2 answers
  • Does the steelseries arctis 9x work with a pcie bluetooth card in windows
    13·1 answer
  • There are three required elements needed to connect to the internet: internet service provider, hardware, and __________.
    13·1 answer
  • The Internet is a hierarchical structure linking different levels of service providers whose millions of devices supply all the
    13·1 answer
  • What is the outside of an iPhone called?
    9·2 answers
  • Write the definition of a function named newbie that receives no parameters and returns 1 the first time it is invoked (when it
    7·1 answer
  • To celebrate me reaching expert in the same day i made the account im doing a point giveaway
    12·2 answers
  • Assume that the client wants to retrieve the www.cnn home page but has no information about the www.cnn web server IP address. D
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!