File: Money.asm #3 Author: ************ Date: mm/dd/yyyy # Purpose: Practice floating point; Break down cash to bills and coins #- # WRITE MIPS CODE FOR THE FOLLOWING C++ CODE: #3 #include #include #include #using namespace std; float cash; int remainder , twenty, ten, five, one, quarter, dime, nickel, penny; void main() { #3 # # cout <« "Enter amount of cash: "; //enter 56.68 cin >> cash; remainder = (int)(100.0f * cash) //use integers from now on twenty = remainder / 2000; remainder = remainder % 2000; ten = remainder / 1000; remainder = remainder %, 1000; five = remainder / 500; remainder = remainder % 500; one = remainder / 100; remainder = remainder % 100; quarter = remainder / 25; remainder = remainder % 25; dime = remainder % / 10; remainder = remainder % 10; nickel = remainder / 5; penny = remainder % 5; cout # #3 #3 //$20 #3 //$10 # //$5 #3 #3 //$1 #3 #3 //$0.25 2# #3 //$0.10 # //$0.05 //$0.01 #3 <« "\nTwenty \t" « twenty « "\nTen << "\nFive « "\nOne « "\nQuarter \t" « quarter « "\nDime <« "\nNickel \t" << nickel « "\nPenny %23 \t" <« ten \t" <« five \t" << one %23 #3 #3 # \t" <« dime #3 \t" « penny « endl; }//end main(O # SAMPLE OUTPUT: Enter amount of cash (56.68): 56.68 23 23 Twenty # 2 Ten Five One Quarter Dime Nickel #3 # Penny 3
File: Money.asm #3 Author: ************ Date: mm/dd/yyyy # Purpose: Practice floating point; Break down cash to bills and coins #- # WRITE MIPS CODE FOR THE FOLLOWING C++ CODE: #3 #include #include #include #using namespace std; float cash; int remainder , twenty, ten, five, one, quarter, dime, nickel, penny; void main() { #3 # # cout <« "Enter amount of cash: "; //enter 56.68 cin >> cash; remainder = (int)(100.0f * cash) //use integers from now on twenty = remainder / 2000; remainder = remainder % 2000; ten = remainder / 1000; remainder = remainder %, 1000; five = remainder / 500; remainder = remainder % 500; one = remainder / 100; remainder = remainder % 100; quarter = remainder / 25; remainder = remainder % 25; dime = remainder % / 10; remainder = remainder % 10; nickel = remainder / 5; penny = remainder % 5; cout # #3 #3 //$20 #3 //$10 # //$5 #3 #3 //$1 #3 #3 //$0.25 2# #3 //$0.10 # //$0.05 //$0.01 #3 <« "\nTwenty \t" « twenty « "\nTen << "\nFive « "\nOne « "\nQuarter \t" « quarter « "\nDime <« "\nNickel \t" << nickel « "\nPenny %23 \t" <« ten \t" <« five \t" << one %23 #3 #3 # \t" <« dime #3 \t" « penny « endl; }//end main(O # SAMPLE OUTPUT: Enter amount of cash (56.68): 56.68 23 23 Twenty # 2 Ten Five One Quarter Dime Nickel #3 # Penny 3
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
7
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education