cashChq = input('Enter the value of the cheque to be cashed: ');
nDollar = floor(cashChq);
centVal = cashChq - nDollar;
vC = centVal*100;
while (cashChq < 0) | (rem(vC,5) ~= 0)
cashChq = input('Invalid entry; pennies no longer exist! Please enter the value of the cheque to be cashed, \na non-negative dollar amount with cents in multiples of five: ');
end
nToon = floor(cashChq/2);
toonVal = nToon*2;
amtRem = (cashChq-toonVal);
nLoon = floor(amtRem);
nQrtrs = floor(vC/25);
nDms = floor((vC - nQrtrs*25)/10);
centRem = (vC - nQrtrs*25 - nDms*10);
nNckls = (centRem/5);
fprintf('There are %i toonies, %i loonies, %i quarters, %i dimes, and %i nickels.',nToon,nLoon,nQrtrs,nDms,nNckls);
end