Your cart is currently empty!
Outcomes: Write programs that obtain user input Write programs that use if and else statements Write programs that work with random numbers Write programs that display numbers formatted according to a given specification Format and comment source code that adheres to a given set of formatting guidelines Scoring: At a bare minimum, the program…
Outcomes:
Scoring:
At a bare minimum, the program you submit must have the assigned source code, and your source code must compile and run without crashing.
Full credit | No credit or Partial credit | |
Generate random problems
(12 points) |
You used Math.random() to generate random multiplication and division problems as specified. Your random numbers allow for all possible multiplication problems up to the limit set by the user. | Numbers are not random, or do not conform to specifications. |
Check user answers
(12 points) |
You determine whether the user correctly solves the 6 problems. | There are errors in determining whether the user answer is correct. |
Display statistical results
(12 points) |
You correctly compute all the numerical results, including ongoing count, the elapsed time, and the final counts and percentages. | There are errors in your computations, or some computations are missing. |
Format console output
(4 points) |
You formatted output as specified, including rounding percentages to the correct number of decimal places. | Screen output does not match specifications. |
Preliminaries:
(int)(1 + 6 * Math.random())
This produces random integer values from 20 through 23, inclusive:
(int)(20 + 4 * Math.random())
Assignment:
Write a program that gives the user 3 random multiplication problems, followed by 3 random division problems to solve. Display the user’s ongoing progress, final scores, and elapsed time. Your program should allow the user to select the difficulty level of the problems, and should match the formatting shown in the sample run as closely as possible.
Requirements:
Your program should meet all of the following requirements:
Sample run:
Your program should match this format as closely as possible. Note that text shown in red is there because the user typed it. You are not supposed to print those.
Welcome to my math quiz!
This quiz will give you three multiplication problems, and then three division problems. —————————————————– Enter the multiplication limit: 100 Enter the division limit: 50
The timer starts…now!
-MULTIPLICATION————————————– 5 * 10 = 50 Yes! You have 1 correct so far. 8 * 7 = 56 Yes! You have 2 correct so far. 8 * 9 = 71 Sorry, 8 * 9 = 72. You have 2 correct so far.
-DIVISION——————————————– 42 / 6 = 5 Sorry, 42 / 6 = 7. You have 2 correct so far. 50 / 5 = 10 Yes! You have 3 correct so far. 1 / 1 = 0 Sorry, 1 / 1 = 1. You have 3 correct so far.
The timer stops…now! You answered in 47 seconds.
-RESULTS——————————————— Multiplication score: 2 out of 3 (66.667%) Division score: 1 out of 3 (33.333%) Overall score: 3 out of 6 (50.000%) |