Lab #3


A gumball machine contains 20 gumballs.

Using a while loop:
As long as there are gumballs in the machine:
Have the person request between
1 and 5 gumballs. Make sure you check to see
that the person only selects 1 to 5 gumballs.

As long as there are at least that many
gumballs in the machine have that amount removed
from the gumball machine. Give an error if there are
no enough gumballs. Display the amount taken and the
current total of gumballs in the machine.

A person can stop the program at anytime, by selecting 0
gumballs. Let the person know that option exists.