Question: Please help, I will rate ASAP ! A cashier distributes change using the maximum number of five dollar bills, followed by one dollar bills. Given

Please help, I will rate ASAP !

Please help, I will rate ASAP ! A cashier distributes change using

A cashier distributes change using the maximum number of five dollar bills, followed by one dollar bills. Given amountToChange, assign numFives and numOnes with the number of five dollar and one dollar bills distributed. Ex: If amountToChange is 19, then numFives is 3 and numOnes Is 4. function [numFives, numOnes] = ComputeChange(amountToChange) % amountToChange: Amount of change in dollars % Assign numFives with the number of five dollar bills distributed numFives = mod((amountToChange-5)/5); % Assign numOnes with number of one dollar bills distributed numOnes = numFives/1 end

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!