Question: write a program in x 8 6 MASM and include irvine library Write a program that does the following: 1 ) Prompt the user to

write a program in x86 MASM and include irvine library Write a program that does the following:
1) Prompt the user to enter a decimal number with at least 5 decimal places. Also allow
for the case where the user can enter numbers greater than 1.
2) Read the user input and display on the screen. Something like the following... The
original number entered was x.xxxxx.
3) Prompt the user to enter a precision value between 1 and 4.
4) Read the user input and display on the screen. Something like the following... You
selected to set the precision to x decimal places.
5) Round to the specified precision setting and display on the screen. Something like
the following...
Original Number: 34.26598
Precision 3: 34.266 ##Depending on the precision value selected.
6) Include error messages in the event the user indicates a precision value that is not 1,2,3, or 4.
7) You may not use the rounding instruction for this assignment.
Suggested Approach
The most common method used for this assignment is to
Multiply by the appropriate power of 10.
Convert the value to an integer.
Convert the integer back to a floating point value.
Divide by the appropriate power of 10.
For example, if your value is 1.23456 and the precision is 2
Multiply by 100: 123.456
Covert the value to an integer: 123
Convert the value back to a floating point: 123.00...
Divide by 100: 1.2300...
The floating point instructions are in Section 12.2
Note: Floating Point Values will be displayed in Scientific Notation in the console window.
Extra Credit: Display the number correctly in Decimal Notation (not Scientific Notatio

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!