Question: You have been hired to help write the software for an automatic change dispenser, the kind you see attached to a cash register, which automatically

You have been hired to help write the software for an automatic change dispenser, the kind you see attached to a cash register, which automatically dispenses the right coins depending on the amount of change that is owed to the customer. Thus, the first function you will write should be called giveChange. Your function should take one input variable. The input will be an integer from 0 to 99, representing the amount of change needed. The function should return four outputs: quarters, nickels, dimes, and pennies. These variables should hold the number of each coin that should be dispensed. Recall that a function can return multiple outputs using the following return statement: return quarters, nickels, dimes, pennies To get each variable out, you can use simultaneous assignment (review slides on assignment). You have been hired to help write the software for an automaticchange dispenser, the kind you see attached to a cash register, which

You have been hired to help write the software for an automatic change dispenser, the kind you see attached to a cash register, which automatically dispenses the right coins depending on the amount of change that is owed to the customer. Thus, the first function you will write should be called 'giveChange'. Your function should take one input variable. The input will be an integer from 0 to 99, representing the amount of change needed. The function should return four outputs: quarters, nickels, dimes, and pennies. These variables should hold the number of each coin that should be dispensed. Recall that a function can return multiple outputs using the following return statement: return quarters, nickels, dines, pennies To get each variable out, you can use simultaneous assignment (review slides on assignment). For example, our test case could look like the following

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!