Well, for starters you don't have to use the method heading of private "int" and then have a return null; line.
Make that method like this:
private static void setNumber(){
}
Then, in the IF statements, you can't use commas to separate things like that. Really the best way to do this would be a loop and a switch. The current way you have it setup, it is taking the entire String "word" and comparing it to just one letter. You need to setup a loop structure like the following:
for(int i = 0; i<7; i++){
if(word.charAt(i) == 'A' || word.charAt(i) == 'B' || word.charAt(i) == 'C' .... etc.){
//You need one of each option if you are using if statements, separated by two vertical bars (the shift+black-slash). That's why a switch would be
//easier but this is just to show you how to alter your code the way you have it started.
//Also, since this is comparing a char and not a string, your == A has to be put in apostrophes: 'A'
number = number + "2";
}
else if(word.charAt(i) == 'E' || ....){
number = number + "3";
}
}
That loop checks every character up to the 7th one and compares it to each possible character. All you would need to do is create the additional IF statements to check for the other letter/number combinations.
I hope this isn't using Java that you haven't learned yet. If this is too advanced for the stage of your class you are in, let me know and I'll try to think of a more basic way to do this.







