No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
In the last line of this method I am getting a missing return statement error, and I cannot figure out why. Any ideas? public static int parameter(int g){ Scanner console=new Scanner(System.in); String hint=console.next(); if(hint.equals("low")){ g=(g/2)+g; return g; }else if(hint.equals("high")){ g=(g/2); return g; }else if(hint.equals("correct")){ g=g; return g; } } |
|
In this code, I am prompting the user to pick a number from 1-1000 and having the user keep it in his/her head. Then, in 10 tries or less I am trying to have the computer guess the user's number. This is what I have so far... import java.util.*; public … |