Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1) You may NOT use any classes from java.util except java.util.Scanner. In particular, you are NOT allowed to use the Random class, the ArrayList class,

1) You may NOT use any classes from java.util except java.util.Scanner. In particular, you are NOT allowed to use the Random class, the ArrayList class, the Arrays class, etc. If the class you want to use is NOT in the java.lang package (String, Math for example) or if it is not java.util.Scanner then you should not be using it for this assignment.

2) You will need to use Math.random() for all randomization in your code. You will need to figure out how to use the output of this (a double between 0.0 and 1.0; but not including 1.0) to generate the random things you want (do you ask an addition or subtraction question; generating random byte values).

3) You will need to use the String class.

4) You must use a Scanner object for all user input.

image text in transcribed

Write a class called QuizProgram that simulates a quiz that helps a young child practice addition and subtraction. The program randomly computes 10 quiz questions which are either addition or subtraction questions in the form of N1-N2 or N1 + N,- guessed answer to the math expression. N1 should be a number from 0 to 99 and N2 should be a number from 0 to N1. The decision to use an addition or subtraction operator in the question should be chosen randomly as well, with equal probability. If the user types in the correct answer, the program should say "You are correct!", otherwise it should print "Sorry, the correct answer is-'. After the 10 questions have been asked, the program should show the % of correct answers where the user tvpes in the Here is example output (colors added for emphasis only) What is the answer to 3 03 You are Correct! What is the answer to 22 - 11 11 You are Correct! What is the answer to 17 - 13 4 You are Correct! What is the answer to 93 21 5 Sorry, the correct answer is 114 What is the answer to 70 12 82 You are correct! What is the answer to 88-4312 Sorry, the correct answer is 45 What is the answer to 88+ 42-130 You are correct! What is the answer to 94-5935 You are correct! What is the answer to 91 + 62-153 You are correct! What is the answer to 6820 48 You are correct! You scored 80% on the quiz

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Current Trends In Database Technology Edbt 2006 Edbt 2006 Workshops Phd Datax Iidb Iiha Icsnw Qlqp Pim Parma And Reactivity On The Web Munich Germany March 2006 Revised Selected Papers Lncs 4254

Authors: Torsten Grust ,Hagen Hopfner ,Arantza Illarramendi ,Stefan Jablonski ,Marco Mesiti ,Sascha Muller ,Paula-Lavinia Patranjan ,Kai-Uwe Sattler ,Myra Spiliopoulou ,Jef Wijsen

2006th Edition

3540467882, 978-3540467885

Students also viewed these Databases questions

Question

Discuss the techniques of job analysis.

Answered: 1 week ago

Question

How do we do subnetting in IPv6?Explain with a suitable example.

Answered: 1 week ago

Question

Explain the guideline for job description.

Answered: 1 week ago

Question

What is job description ? State the uses of job description.

Answered: 1 week ago

Question

What are the objectives of job evaluation ?

Answered: 1 week ago

Question

Understanding Group Leadership Culture and Group Leadership

Answered: 1 week ago