for (count=1; count<=10; count++)
{
number1= randomNumber.nextInt(10)+1;
number2= randomNumber.nextInt(10)+1;
Help correct= new Help(number1, number2);
switch(choice)
case 2:
if (number1 > number2)
{
System.out.print("What is the answer to this problem? " +
number1 + "-" + number2 + ":");
ans= keyboard.nextInt();//stops at 2 problems!!!!!!
a= correct.getSub();
if(ans == a)
{
System.out.println("The answer is CORRECT!!!!!");
System.out.println();
rigth +=1;
}
else
{
System.out.println("The answer is INCORRECT!!!");
System.out.println("The correct answer is: " +a);
System.out.println();
}
}
littlemini 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.