Question: how do I make this calculator using ascii characters? Create a program that performs simple calculations: it reads-in statements like 2+2 and it prints-out the
Create a program that performs simple calculations: it reads-in statements like 2+2 and it prints-out the answer: 4 In order to do so, it is important to convert the ASCII characters to integers. The easiest wa to do this conversion is to mask-out all but the least-significant four bits: a =00f; (The ASCII codes for the numbers are 030 to 039. ) You will also need to convert the result back to ASCII. Assume single-digit terms. The operation can be either addition ' + ' or subtraction ' '. If the answer is greater than ten, print a ' 1 ' and then print the result minus ten (converted back to ASCII)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
