1,105,427 Community Members

Multiplication table quiz

Member Avatar
wolfy101
Newbie Poster
1 post since Nov 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 
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
				double answer;

				System.out.print("\nMultiply these two numbers together: ");
				System.out.print(valueFirst);System.out.print(" * ");System.out.println(valueSecond);
				answer = a.nextDouble();
		
				if(answer == (valueFirst * 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 );
	}

}

that is what i have so far :), basically i want to ask the user what multiplication table they would want to do the quiz on..

So if you enter 5 it asks you only 5*1-12

Member Avatar
rigidboss
Newbie Poster
21 posts since Dec 2007
Reputation Points: -10 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

you are almost there...

Jus get the input from the user.

I mean the number ---> eg 5 or some thing...

Then assign this value to valueFirst.

got it ??????

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article