It would look something like this:
In your main() method:
while (credit > 0) {
int bet = getBet();
// pass the parameter bet to the winAmount() method:
int winnings =...
Type: Posts; User: GregBrannon
It would look something like this:
In your main() method:
while (credit > 0) {
int bet = getBet();
// pass the parameter bet to the winAmount() method:
int winnings =...
Pass the value needed by the winAmount() method as a parameter and remove the code from winAmount() that calls getBet().