1. Member
Join Date
Nov 2009
Posts
1
Rep Power
0

## Multiplication table quiz

well i need help making a program that basically asks the user what multiplication table he would like to do (quiz).

It asks the user what multiplication table would you like to do.

example. i pick 5 it will ask every problem that involves 5

5*0
5*1
5*2
5*3
5*4
5*5
5*6
5*7
5*8
5*9
5*10
5*11
5*12

now heres the current code i have
PHP Code:
```import java.util.*;
class multiplicationquiz
{
public static void main(String[] args)
{
Scanner a = new Scanner(System.in);

int b,right,totalscore;
right = 1337; //boredom
totalscore = 0;
b = 0;

do
{
double numb = Math.round((Math.pow(10, 2) * Math.random()));
double numb1 = Math.round((Math.pow(10, 2) * Math.random()));
double valueFirst;
double valueSecond;
valueFirst = numb % 12; //Highest Number
valueSecond = numb1 % 12;	//Highest Number

System.out.print("\nMultiply these two numbers together: ");
System.out.print(valueFirst);System.out.print(" * ");System.out.println(valueSecond);

{
System.out.println("\nOMG YOU GOT IT CORRECT CHEESE!");
right++;
}

else
{
System.out.println("\nOMG YOU ARE A FAILURE!");
}
b++;
}
while (b < 10 ); //Number of questions to be asked.
totalscore = right - 1337;
System.out.println("\nYour total sexyness is : " + totalscore );
}

}```

2. Senior Member
Join Date
Nov 2009
Posts
235
Rep Power
8
Maybe have the program start by asking th user for the first number, then randomly generate the second number, then display their first input * random, then verify if their input is the same as the answer.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•