on line 17 I call getMenuOption, with x inside the parameter. What exactly does x repsresent? I am trying to pass my menu selection input to the getMenuOption that was called in the main method.
however, when I go to make my switch statement, I use x within my parameters, should I be using variable x or variable menuselection?
Obviously a variable name "x" isn't descriptive (unless you are calculating coordinates). You are calling a method named getMenuSelection, what does it return?
Also, you should only create a Scanner for System.in *once* and then reuse it.
Carey Brown wrote:You are repeating the same problem. You are passing in a variable "op" and then not using it. Only pass in the values you actually need to perform some operation.
You seem to be under the misconception that in order to get something out that you have to pass it in first. This is not true.
...now All of my return answers are not being resolved to a variable in my switch statements, any idea how to fix this part?
You didn't follow my example correctly. You still need to call getMenuOption() inside the do() loop.
Carey Brown wrote:That's because you've defined "choice" inside the "do" block. Outside of the block (which ends with a '}') the variable goes out of scope and is no longer visible. The while() expression is outside of the block, hence, cannot see "choice". (You're not the only one to get confused by this.) The solution is to define "choice" before you enter the "do" block.