If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: Value-returning Method

You do not need to pass in the argument (double numberOfCups) to getCups. You should declare numberOfCups as a double within the method.
You could make the method more resilient. What would happen if the user entered a string (e.g. "Hello") or a negative number?
You could pass the question string "Enter number of cups" as a String argument, check that the user enters a sensible value and return the value if it is, otherwise provide some guidance and ask the question again.