-5

私は java.util.scanner を試していましたが、エラーが発生しました。

The error as said in Command Prompt:
 18: error :cannot find simbol
   if (answer.equalsignoreCase("yes));
       ^
symbol: variable answer

これは、コマンド プロンプトから表示されるエラーです。ここに、私が書いたコードを示します。

import java.util.Scanner;
import java.io.IOException;
class bikeGame {
 public static void main(String[] args){

 Scanner scanner = new Scanner(System.in);

 boolean brakes = false;
 byte speed = 5;
 byte gear = 1;

 String start = " Your current speed is 5km/h. You are in the first gear.";
 String welcome = "Welcome to Bike Rider! You can use the commands 'faster', 'slower' and 'brakes'. Type   'start' to begin...";
 String die = "You died, type 'start' to play again...";
 System.out.println(welcome);
 String input = scanner.nextLine();
 System.out.println("You selected " + input + "? Is this correct? <true or false>");
 if (answer.equalsgnoreCase("yes"));
 System.out.println(start);
 float b;
 float c;
 float d; 



 Scanner myScanner = new Scanner(System.in);

 b = myScanner.nextFloat();
 c = myScanner.nextFloat();
 d = myScanner.nextFloat();



 }
}

問題が発生した場合は、遠慮なくご回答ください...

4

1 に答える 1