original code:
int question,
String answer;
Corrected code:
int question, answer;
question = input.nextInt ();
if (question == 3*6*4) { ... }
Updated code below:
import java.util.Scanner;
class Main
{
public static void main (String[]args)
{
System.out.println
("How much dirt is there in a hole 3 ft deep, 6 ft long and 4 ft wide? ");
Scanner input = new Scanner (System.in);
String ans;
ans = "None";
do
{
int question, answer;
question = input.nextInt ();
if (question == 3*6*4)
{
System.out.println ("Correct! or else it wouldn't be hole.");
break;
}
else
{
System.out.println ("Wrong, try again.");
}
}
while (ans.equals ("None"));
}
}