java - Cannot find symbol - method guess() -
im new java , im struggling understand basics. because of cant understand why wont compile.
the error appearing on int guess = input.guess();
and says cannot find symbol - method guess().
thanks in advance help
public class hilo { private int upper; private int randomnumber; private input input; private boolean won; private int guesses; public hilo(int x) { upper = x-1; randomnumber = (int)(math.random() * upper)+1; input = new input(); won = false; guesses = 10; } public void playhumangame() { while ((won == false) && (guesses > 0)) { int guess = input.guess(); guesses--; if (guess > randomnumber) { system.out.println("you're high pal"); } else if (guess < randomnumber) { system.out.println("you're not high enough"); } else { system.out.println("you won game... done suppose..."); won = true; } } } }
java compiler-errors
No comments:
Post a Comment