My goal is to receive from standard input an equation, store that in an array for later use/re-printing, then output a line printing the whole equation AND the answer after just like so:
Input: 2+3=
Output: 2 + 3 = 5
I am very confused on how to go about doing this due to the inability of Ada to have dynamic strings and such.
This is a rough idea that I have in pseudo-code..
Until_loop:
loop
get(INT_VAR);
--store the int in the array?
get(OPERATOR_VAR);
--store the operator in the following index of that array? and
--repeat until we hit the equal sign, signaling end of the equation
get(CHECK_FOR_EQUALSIGN);
exit Until_loop when CHECK_FOR_EQUALSIGN = "=";
end loop Until_loop;
--now that the array is filled up with the equation, go through it and do the math
--AND print out the equation itself with the answer
I am guessing the array should look like:
[2][+][5][=][7]
I am also a beginner with Ada, so it's even more difficult to get a grasp of things, I am very good with Java, but I can't get used to the strongly typed syntax. Please ask if you need more info.