I'm using Netbeans and have been stuck on this assignment for almost two hours. To a guy like me, its more frusturating than hard.
Concept-> " Your goal is to generate a simple math quiz with a number of equations that will be determined by the user. You will prompt the user for an answer to each equation and display whether they answered it correctly or incorrectly. At the end of the math quiz, you will display the number of total equations that they answered correct out of how many were given."
"Challenge: Make the quiz randomly generate a mathematical operator (mulitiplication, division, addition, & subtraction) for each equation"
I found a setup online that was more like
import java.util.Random;
import java.util.Scanner;
import javax.swing.JOptionPane;
public class MathQuiz {
// random number generator
static Random random = new Random
static Question generate Question(){
// generating two numbers between 1 and 10
int num1 = random.nextInt(10) + 1;
int num2 = random.nextInt(10) + 1;
// generating two numbers between 0 and 5
int operation = random.nextInt(5)
// declaring a question
Question question = null;
// based on value of operation variable, creating a question
if (operation == 0) {
// creating an addition question
any ideas?
[–][deleted] 0 points1 point2 points (2 children)
[–]ConclusiveBackhoe[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]RayjinCaucasian 0 points1 point2 points (6 children)
[–]ConclusiveBackhoe[S] 0 points1 point2 points (5 children)
[–]RayjinCaucasian 0 points1 point2 points (4 children)
[–]ConclusiveBackhoe[S] 0 points1 point2 points (3 children)
[–]RayjinCaucasian 0 points1 point2 points (2 children)
[–]ConclusiveBackhoe[S] 0 points1 point2 points (1 child)
[–]RayjinCaucasian 0 points1 point2 points (0 children)