I have written a code in IJVM which performs multiplication, addition and subtraction on 1 digit numbers.
Basically it reads the input char, then checks the arithmetic symbol (+|-|*), reads the second char and performs the corresponding code (based on the symbol) calculations and inputs the result
so the input:
2+4=
results in output:
6
input:
2*4=
output:
8
Now the problem is obviously that I can't output values greater than 9 as bigger digits are more than one char. 9+1= results in output of ":",
9+2=";" (0x3B)
9+3="<" (0x3C)
Now I've tried looking into add.jas example which is provided as part of the IJVM MIC documentation on ontko.com website. it takes 2 numbers from the input and outputs the sum. However the way it handles the input and output is let's just say... different. After going through it line by line I still can't figure out how to output number consisting of 2 or 3 digits (the requirements are up to "999" for the output result and single digits for the input calculations). And ideally, I don't need those zeros at the beginning in the output which add.jas generates which are not needed and have no purpose. I mean: ("
2+4=00000006
" ? Gimme a break.)
What's the most efficient way of being able to handle larger numbers in the output (up to 999) to implement for my code?
I believe it's absolutely not necessary to paste my whole code as for someone who is more advanced in IJVM who would know what I'm talking about - he surely has a pretty good idea of how my code looks like based on my description.
For the record: I'm reluctant to share my code due to the fact that this is UNI assignment and rules regarding duplicate code / copying someone else are extremely strict with quite harsh consequences for both parties. And I know for a fact that some/many people from my UNI who have the same assignment are scouting the internet. Thank you for understanding!