fork download
  1.  
  2. import java.util.Scanner;
  3. public class TheSpeedOfSound
  4. {
  5. public static void main(String[] args)
  6. {
  7. String air, water, steel;
  8. int distance, time;
  9. Scanner keyboard = new Scanner(System.in);
  10. System.out.println("Enter air, water, or steel: ");
  11.  
  12. air = keyboard.nextLine();
  13. water = keyboard.nextLine();
  14. steel = keyboard.nextLine();
  15.  
  16. System.out.print("Enter distance: ");
  17. distance = keyboard.nextInt();
  18.  
  19. switch (air || water || steel)
  20. {
  21. case air:
  22. time = (distance / 1100)
  23. System.out.println("The total time traveled is " + time + ".");
  24.  
  25. case water:
  26. time = (distance / 4900);
  27. System.out.println("The total time traveled is " + time + ".");
  28.  
  29. case steel:
  30. time = (distance / 16400);
  31. System.out.println("The total time traveled is " + time + ".");
  32. }
  33. }
  34. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:22: error: ';' expected
			time = (distance / 1100)
			                        ^
1 error
stdout
Standard output is empty