Download the program calculator000.cpp
that implements the calculator example from the text
book.
Test it and determine if it works correctly. If it does not, understand what goes wrong. Repair it.
Complete your program by:
%
Download the following extension of the calculator example debug it and correct it.
Organize your code in header and source files and add:
Then, make an archive of all your files:
tar czvf myprogram.tgz directory/
Exchange your calculator programs, test the code that you receive and report back bugs and misbehaviours. To uncompress the files that you receive execute:
tar xzvf myprogram.tgz
Download the following extension of the calculator example debug it and correct it.
It implements the following abilities:
the ability to use {}
beside ()
with the correct precedence
between the two types of parenthesis. (Ex. 2 ch 6)
a factorial operator as a suffix !
. (Ex. 3 ch 6)
the possibilty to define variables. For example:
let v = 5;
Check how these are implemented.
To handle key words like let
you might need to add an higher level to
your Grammar.