Question: Your program should contain the following variables: state - this will store the current state of the machine. Initial value: A cost -

Your program should contain the following variables:
state - this will store the current state of the machine. Initial value: "A"
cost - this is the cost of each item in the machine. Initial value: 7
money - the total amount of money currently inserted into the machine. Initial value: 0
item - the item selected by the user in state C and dispensed in state D.1 is soda, 2 is snack, 3 is candy. Initial value: 0
inv_soda - this the number of sodas in the machine. Initial value: 4
inv_snack - this the number of snacks in the machine. Initial value: 2
inv_candy - this the number of candy bars in the machine. Initial value: 3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!