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 !

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
Get step-by-step solutions from verified subject matter experts
