Write an 80x86 assembly language program (masm) to compute and display the total
ID: 3565077 • Letter: W
Question
Write an 80x86 assembly language program (masm) to compute and display the total value of the coins
in dollar and cents.
Input: The program reads the number of coins(pennies, nickels, dimes, and quarters from the user.
Output: The program displays dollars and cents for the total as well as the number of coins with THREE lines of message.
You may not use any division instruction. The data section must include four labels each of which is for a character string to prompt for the number of coin type
Explanation / Answer
I have programmed in c++
#include <iostream>
using namespace std;
int main ()
{
double price = 0.0;
double amount tendered = 0.0;
change = 0.0;
int 50 dollars;
20 dollars;
10 dollars;
5 dolars;
1 dollar;
50 cent pieces;
quarters;
dimes;
nickels;
pennies;
cout << "enter price and press enter ";
cin >> price;
cout << "enter amount tendered and press enter ";
cin >> amount tendered;
change = price - amount tendered;
cout << "here's your change..Thank you: << change ";
change = change * 100;
50 dollars = change/5000;
change = change % 5000;
20 dollars = change/2000;
change = change % 2000;
10 dollars = change/1000;
change = change % 1000;
5 dollars = change/500;
change = change % 500;
1 dollar = change/100;
change = change % 100;
50 cent pieces = change/50;
change = change % 50;
quarters = change/25;
change = change % 25;
dimes = change/10;
change = change % 10;
nickels = change/5;
change = change % 5;
pennies = change/1;
change = change % 1;
cout << 50 dollars 20 dollars 10 dollars 5 dollars 1 dollar 50 cent pices quarters dimes nickels pennies ;
return 0
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.