私はJavaの初心者です。誰かが次のコードのエラーを特定して修正するのを手伝ってくれませんか? ありがとう!
import java.util.Scanner;
import java.util.Random;
public class p6_35
{
public static void main( String[] args )
{
Scanner input = new Scanner( System.in );
Random randomNumbers = new Random();
toMultiply();
}
public static void toMultiply();
{
int number1 = randomNumbers.nextInt();
int number2 = randomNumbers.nextInt();
System.out.printf( "How much is %d times %d?\n", number1, number2 );
int answer = input.nextInt();
int corrAns = number1 * number2;
if( corrAns == answer )
{
System.out.print( "Very good!" );
}
while( corrAns == answer )
{
number1 = randomNumbers.nextInt();
number2 = randomNumbers.nextInt();
System.out.printf( "How much is %d times %d?\n", number1, number2 );
answer = input.nextInt();
corrAns = number1 * number2;
if( corrAns == answer )
{
System.out.print( "Very good!" );
}
}
while( corrAns != answer )
{
System.out.printf( "No. Please try again.");
answer = input.nextInt();
corrAns = number1 * number2;
if( corrAns == answer )
{
System.out.print( "Very good!" );
}
}
}
}