Question: using matlab change(0,0,1,1) 3) A program in a vending machine uses a function called change. Write the function called change that takes as input an

using matlab
 using matlab change(0,0,1,1) 3) A program in a vending machine uses

change(0,0,1,1) 3) A program in a vending machine uses a function called change. Write the function called change that takes as input an amount of cents stored in the variable money) and calculates the number of quarters, dimes, nickels, and pennies to dispense to the user. These quantities are returned as output and stored in the variables quarter, dime, nickel, and penny. The total number of coins dispensed to the customer should be minimized (you cannot make the vending machine only dispense only pennies, unless money is between 1 and 4 cents). For example, if money is 132 cents, then quarter would be 5, dime would be 0, nickel would be 1, and penny would be 2. ( 5 points) Quarter 25 cents Dime= 10 cents Nickel = 5 cents Penny = 1 cent

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!