Marketplace

Related Articles

More

Related Categories

Recently Added

More

Join StudyUp.com Today

It's always free and anyone can join!

Watch StudyUp Demo Video Now

You Recently Visited

Writing Prompt Elementary

David Said:

help me with java?

We Answered:

Here is a solution that is as good as it gets.

import java.util.Random;
import java.util.Scanner;
public class Problem
{
public static void Problem()
{
int num1 = 0;
int num2 = 0;
int answer = 0;
Random r = new Random();
Scanner in = new Scanner(System.in);
num1 = r.nextInt(10);
num2 = r.nextInt(10);

System.out.println(num1 + " times " + num2 + " = ? ");
answer = in.nextInt();

if (answer == (num1*num2))
{
System.out.println("Good job! You got it right!");
Problem();
}
else
{
while (answer != (num1*num2))
{
System.out.println("You got it wrong, try again!");
answer = in.nextInt();
}
Problem();
}
}
public static void main(String[] args)
{
Problem();
}
}

I'd use this one.

This will ask questions forever. Have fun with it.

Joyce Said:

Why is my CD-Rom not working? I get the message no disc in drive. I uninstalled and reinstalled the cd-rom.?

We Answered:

You should set the jumper manual on the back of your cd-rom, read here http://sdd.toshiba.com/main.aspx?Path=Se… to set your jumper.

To located your jumper, please read here http://sdd.toshiba.com/main.aspx?Path=Se…

Dwayne Said:

Heyy guys am helping my sister do this c++ project in her skool....any help?!?

We Answered:

Your 'sister', huh? Now you must think we are very gullible.

Chris Said:

How is my paper coming along. And correct me in any way please! Please help!?

We Answered:

Does your teacher want you to make this up from the top of your head, or do you have to cite sources?
Below are two sites to get you started.

Doris Said:

java question I need help with it I'm new and do not know this stuff at all.?

We Answered:

Perhaps you should stick with what you DO know. Here are some Java tutorials that will help you to learn Java to the point where you might be proficient enough to answer these questions. (Good luck, and happy programming.)

Discuss It!