Disclaimer: I'm not asking anyone to do my homework, I just need a guiding hand so that I can finish it.
So for my Java class I am to create a Cows and Bulls game. I am not able to use any String methods, Math.pow, Integer.parseInt, or Double.parseDouble. I am also to methods. Basically, how am I to go about doing the following:
A TA had mentioned doing something like thisgetDigit(int number, int i)-take a positive integer number and an index i as parameters and returns the ith digit (from right) of number. If number does not have ith digit, then it returns -1. This method must make call(s) to numDigits (I have this done already).
public static int getDigit(int number, int i){ for(int j = 0; j <= i-1; j++) j = (number/10); number = number%10; return number; }
but when I try to call it into the main method I get this
Sorry for it being such a long first post and I realize that many will be hesitant to help me, but any help would be appreciated.The method getDigit(int, int) in the type dsafhjsd is not applicable for the arguments
(int)
Thanks
EDIT: If this is in the wrong section, would a mod please move it.
EDIT II: I was able to get it