Results 1 to 2 of 2
  1. #1
    wolfy101 is offline Member
    Join Date
    Nov 2009
    Posts
    1
    Rep Power
    0

    Default 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
    				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 );
    	}
    
    }

  2. #2
    collin389 is offline Senior Member
    Join Date
    Nov 2009
    Posts
    235
    Rep Power
    5

    Default

    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.

Similar Threads

  1. Multiplication table
    By rjones215 in forum New To Java
    Replies: 3
    Last Post: 10-19-2009, 05:34 PM
  2. Replies: 2
    Last Post: 02-23-2009, 03:18 AM
  3. Help with quiz
    By khanzaman in forum AWT / Swing
    Replies: 10
    Last Post: 01-19-2009, 08:45 AM
  4. Help pls with a quiz
    By saytri in forum New To Java
    Replies: 3
    Last Post: 12-23-2007, 07:09 AM
  5. Help with multiplication table
    By Albert in forum New To Java
    Replies: 1
    Last Post: 07-10-2007, 05:44 PM

Posting Permissions

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