3. 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. Example Output What is 7 * 6 ? 42 Correct. Nice work! Want more questions y or n ? y What is 8 * 5 ? 40 Correct. Nice work! Want more questions y or n ? y What is 5 * 5 ? 25 Correct. Nice work! Want more questions y or n ? y What is 8 * 9 ? 66 Incorrect. The product is 72 Want more questions y or n ? n You scored 3 out of 4   Required Textbook: Introduction to Java Programming and Data Structures, Comprehensive Version, Edition: 11th Author: Y. Daniel Liang Publisher: Pearson ISBN: 9780134670942

Question

3. 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.

Example Output

What is 7 * 6 ? 42
Correct. Nice work!
Want more questions y or n ? y
What is 8 * 5 ? 40
Correct. Nice work!
Want more questions y or n ? y
What is 5 * 5 ? 25
Correct. Nice work!
Want more questions y or n ? y
What is 8 * 9 ? 66
Incorrect. The product is 72
Want more questions y or n ? n
You scored 3 out of 4
 

Required Textbook: Introduction to Java Programming and Data Structures, Comprehensive Version, Edition: 11th

Author: Y. Daniel Liang

Publisher: Pearson

ISBN: 9780134670942

Expert Answer

1 Rating

Want to see the step-by-step answer?

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.
Tagged in
Engineering
Computer Science

Related Computer Science Q&A

Find answers to questions asked by students like you.

Q: How to use if else statement

A: If-else statement is used when a particular block of code is to be executed when a certain condition...

Q: Please put into SOP form~xyz + yz + x~y

A: It is said that a Boolean expression consisting solely of Minterms (product terms) is in the form of...

Q: Apply backtracking to the problem of finding a Hamiltonian circuit in the graph below:

A: Hamilton circuit, also called as Hamilton cycle forms a close loop by visiting each node exactly onc...

Q: Write the MIPS assembly code that corresponds to the pseudo codebelow. Assume that the address for i...

A: MIPS instruction:The full form of MIPS is Million Instructions Per Second.The speed of computer’s pr...

Q: Annotate the following MIPS instructions to indicate source registersand destination registers. A so...

A: Annotations for the MIPS instructions mentioned in the question are given below-add $s1, $t2, $t3Add...

Q: Write an application to pre-sell a limited number of cinema tickets. Each buyer can buy as many as 4...

A: Create a java program to pre-sell the cinema ticket.The name of the program is TicketSeller.The maxi...

Q: What is a nested function?  and what part in the following code is considered a nest function??     ...

A:  NOTE:Programming language is not mentioned in the question. The following explanations are given ba...

Q: Arrays Write three statements to print the first three elements of array runTimes. Follow each state...

A: Note: As the user given index value is constant and so the value of index will not be changed while ...

Q: Write a program that asks for the name of an input file. Then, read all the numbers in the file, and...

A: Create a PYTHON3 file in which import io module and validate file in program.Print sum, number of el...