Scott M Summers wrote:In another class, UserInput, I have a method, getString(int minString, int maxString).
I need to pass the variable, month, to method, getString, then have it come back to method inputSystemTask().
Thank you.
Scott,
When you post code, you really should try to give us the full picture. It would appear that your
UserInput class ALSO has a method called
getInput() that takes no arguments, but you haven't shown it, which is a bit confusing for us.
I'm also not quite sure why you would need to pass a "month" to an input method.
I'm guessing here, but I assume that what you want to do is have the
user enter a month, and then validate that it is between 1 and 12 - or maybe between 1 and some "current month", and you want to know how to do that.
If I'm right, then here's my suggestion:
Write a method
in your UserInput class, that forces the user to enter a number within certain limits (
getNumberInRange(...) ?).
Then, to get a valid month, all you need to do is call:
getNumberInRange(1, 12)
You may also find the
UserInput page worth reading. It's fairly long, and the third part still isn't finished; but it might give you some pointers.
Winston