fork download
  1.  
  2.  
  3. import java.util.Scanner;
  4. public class ConvertFeetToInches
  5. {
  6. public static void main(String[] args)
  7. {
  8. int guess = 0;
  9. double inches = 0;
  10. double randNum = 0;
  11. randNum = Math.random();
  12. double RandNum = (int)(randnum * 100);
  13. Scanner in = new Scanner(System.in);
  14.  
  15.  
  16.  
  17. //notice the use of negating the equals() method to terminate the loop
  18. while(guess != RandNum)
  19. {
  20. System.out.println("Guess my number mortal! ");
  21. guess = in.nextInt(); //What happens if a user enters an int, a double, or a String?
  22.  
  23. if (guess > RandNum)
  24. {
  25. Sytem.out print("your guess was too high! TRY AGAIN");
  26. }
  27. else if (guess < RandNum)
  28. {
  29. Sytem.out print("your guess was too low! TRY AGAIN");
  30. }
  31. else
  32. {
  33. Sytem.out print("YOU HAVE BESTED MY NUMBER PUZZLE!!");
  34. }
  35.  
  36.  
  37. }
  38. }
  39.  
  40.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:25: error: ';' expected
                  Sytem.out print("your guess was too high! TRY AGAIN");
                                 ^
Main.java:29: error: ';' expected
                 Sytem.out print("your guess was too low! TRY AGAIN");  
                                ^
Main.java:33: error: ';' expected
                 Sytem.out print("YOU HAVE BESTED MY NUMBER PUZZLE!!");
                                ^
Main.java:38: error: reached end of file while parsing
}
 ^
4 errors
stdout
Standard output is empty