Code in Python and test a MASM program to perform the following tasks: Display your name and
Fantastic news! We've Found the answer you've been seeking!
Question:
Code in Python and test a MASM program to perform the following tasks:
- Display your name and program title on the output screen.
- Display instructions for the user.
- Prompt the user to enter three numbers (A, B, C) in strictly descending order.
- Calculate the sum and differences: (A+B, A-B, A+C, A-C, B+C, B-C, A+B+C).
- Display the results of the above calculations.
- Display a closing message.
Program Requirements
- The program must be fully documented and laid out
- . This includes a complete header block for identification, description, etc., and a comment outline to explain each section of code.
- The main procedure must be divided into the following separate and distinct logical sections:
- introduction
- get the data
- calculate the required values
- display the results
- say goodbye
- When displaying the results, restate the inputs in equation form (e.g. "5 + 4 = 9") rather than using placeholder letters (see the Example Execution below).
- The results of calculations must be stored in named variables before being displayed.
Notes
- You are not required to handle negative input or negative results. We will not test input that would generate a negative output or overflow.
Example Execution
User input inboldface italics.
Elementary Arithmetic by Wile E. Coyote Enter 3 numbers A > B > C, and I'll show you the sums and differences. First number: 20 Second number: 10 Third number: 5 20 + 10 = 30 20 - 10 = 10 20 + 5 = 25 20 - 5 = 15 10 + 5 = 15 10 - 5 = 5 20 + 10 + 5 = 35 Thanks for using Elementary Arithmetic! Goodbye!
Extra Credit Options
- Repeat until the user chooses to quit. (1pt)
- Check if numbers are in strictly descending order. NOTE: Strictly Descending means A > B > C (1pt)
- Handle negative results and computes B-A, C-A, C-B, C-B-A. (1pt)
- Calculate and display the quotients A/B, A/C, B/C, printing the quotient and remainder (see DIV and IDIV instructions). Division by zero need not be properly handled. (2pt)
Related Book For
Quantitative Analysis for Management
ISBN: 978-0133507331
12th edition
Authors: Barry Render, Ralph M. Stair, Michael E. Hanna, Trevor S. Ha
Posted Date: