program has to be written in X86 processor assy language.
Write a program that find the minimum number of coins that can represent an amount of money under $1.
randomRange is called, it creates a random number between 0 and the limit.
Make sure to have a newline at the end of the printed string.
To do this:
3 quarters, 2 dimes, 0 nickels, 1 pennies
It's okay to print the ending 's' even if the number is 1.
Make sure to have a newline at the end of the printed string.
Sample program output
Amount = 78 cents
3 quarters, 0 dimes, 0 nickels, 3 pennies
Additional requirements (make sure to read all 3
requirements)
1. Except for text string variables, the program should not use
any memory variable to store numeric data. Instead, use
registers. (Why?)
2. Given the range of data in the program, use the *smallest* data size (not DWORD) in all your calculations. But you will still need to use DWORD for printing data.
3. Determine whether the data is signed or unsigned, and use the appropriate instructions.
function[coins] = change12(money)
%initial amounts of each coin
quarter = 0;
dime = 0;
nickle = 0;
penny = 0;
% money = [quarter dime nickle penny]; money =[0 0 0 0]
while money>0 % while money>=0 makes an infinte loop
if money >= 25
money = money - 25;
quarter = quarter + 1;
elseif money >= 10
money = money - 10;
dime = dime + 1;
elseif money >= 5
money = money - 5;
nickle = nickle + 1;
elseif money >= 1
money = money - 1;
penny = penny +1;
end
end
coins = [quarter dime nickle penny];
Get Answers For Free
Most questions answered within 1 hours.