Question: Original Question for this Question 8. Using problem 13 from HW1,write pseudocode for the 40 cent soda machine. The pseudocode is started below: switch(state) {

 Original Question for this Question 8. Using problem 13 from HW1,write

Original Question for this Question

pseudocode for the 40 cent soda machine. The pseudocode is started below:

8. Using problem 13 from HW1,write pseudocode for the 40 cent soda machine. The pseudocode is started below: switch(state) { case 1: // No money Display 0 cents on Soda Machine if (coin ==5){ // if statements to decide want to do next time into switch statements state = 2; if (coin= 10) { state = 3; if (coin=25) { state = 6; break; case 2: // 5 cents deposited Display 5 cents on Soda Machine case 9: // 40 cents deposited Dispense Soda state = 0; break; 13. Following the example given in lecture for a similar soda machine, draw the state transition diagram for a soda machine that: a. only dispenses one type of soda. b. the soda costs 40 cents. c. exact change is required. d. if a wrong coin is deposited, like a quarter when 30 cents has already been deposited, the wrong coin will be returned. e. the soda machine only accepts nickels, dimes and quarters

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 Databases Questions!