1. Write a program in the EXE format. 2. The program should contain the followin
ID: 3760978 • Letter: 1
Question
1. Write a program in the EXE format.
2. The program should contain the following procedures:
a. INPUT: Reads the arithmetic expression and checks for its validity.
b. OPERATE: This is not the actual name of the functions. You should write separate procedures for each possible operator, e.g. DO_ADDITION, DO_SUBTRACTION, etc. Each of these functions performs the desired operation.
c. OUTPUT: Converts the result to ASCII code and display it on the screen.
d. CONV_ASCII2HEX: Performs data type conversion from ASCII to hexadecimal. Refer to your textbook for more details on ASCII codes.
e. CONV_HEX2ASCII: Performs data type conversion from hexadecimal to ASCII.
f. ERROR: Prints out different error messages for illegal operators and operands.
3. All the input operands must be handled as signed decimal numbers in the range [-32,768 to +32,767]. The results must be at least twice as long as the inputs (not twice the range). For the division, only the quotient should be displayed.
SAMPE EXECUTION: Assume the executable filename is CALC.EXE
Enter an algebraic command line: -255 / 2
Result: -127
Again? Y <enter>
Enter an algebraic command line: 255 Error!!
Input format: Operand1 Operator Operand2
Operand: decimal numbers
Operator: + - * / %
Again? N <enter>