Project 2: Expression Evaluator
|Due||Friday, December 6th, 2019|
Create a Win32/C++ 17 console application that completes the implementation of the Expression Evaluator base code (provided) that reads integers and outputs the result. To do this, on the existing code base, you must implement the infix to postfix algorithm (Shunting yard algorithm by Edsger Dijkstra, http://en.wikipedia.org/wiki/Shunting-yard_algorithm) then implement a postfix to result algorithm (Postfix algorithm, http://en.wikipedia.org/wiki/Reverse_Polish_notation).
Advanced requirements are graded only if the base (shunting yard and postfix algorithm) is complete and all boost test cases are working. The advanced requirements are to implement the Boolean data type along with its appropriate operators (AND, OR, NOT, XOR, NAND, NOR, XNOR) and real data types from the console and outputs the result. Errors in the expression should be reported to the users and the program should continue operation (so program does not crash).
Note: Additional details, algorithms, design discussion will be provided in class.
- Complete the postfix algorithm to finish implementing the integer postfix algorithm evaluator (RPN evaluator).
(add to the existing code the postfix algorithm)
- Verify that all boost unit tests provided with the code will pass.
- Develop the end user application.
- Result Function
- Add the Gregorian data type from Project 1.
- You’ll need to add the packaged day, month, and year objects (integer only)
- You’ll need operation objects to handle the day/month/year functions and the Gregorian constructor.
- Create a specialized Gregorian operand (called now) that initializes to the current date.
- You do not need to handle time of day.
objective is to be able to process expressions such
Gregorian(2019,10,10) + months(2) – days(5)
now > Gregorian(2019,10,8)+days(20)
This project will be graded using the following criteria.
|Using this document: Highlight in Yellow the functional requirements which you have implemented. Put in BOLD AND ITALICS the RPN architecture that you have chosen to implement here. Big If Operand Polymorph Operator Polymorph Double Dispatch Lookup Table||-10% if missing||
|ut_rpn_evaluator – Postfix algorithm TEST_INTEGER TEST_UNARY_OPERATOR TEST_BINARY_OPERATOR TEST_FUNCTION TEST_SINGLE_ARG TEST_MULTI_ARG TEST_REAL TEST_MIXED TEST_BOOLEAN TEST_RELATIONAL_OPERATOR TEST_VARIABLE TEST_RESULT||(40% total) 5% 5% 10% 2% 3% 2% 3% 2% 2% 2% 2% 2%||
|ut_expression_evaluator TEST_INTEGER TEST_UNARY_OPERATOR TEST_BINARY_OPERATOR TEST_NAMED_OPERATOR TEST_RIGHT_ASSOCIATIVE_OPERATOR TEST_FUNCTION TEST_SINGLE_ARG TEST_MULTI_ARG TEST_REAL TEST_MIXED TEST_BOOLEAN TEST_RELATIONAL_OPERATOR TEST_VARIABLE TEST_RESULT||(40% total) 5% 5% 5% 1% 1% 2% 1% 2% 3% 2% 2% 2% 2% 2%||
|ee – end user console application Tests to be determined by your professor We will look for error cases||(10% total)||
Wrote and passes
your own parser tests
Wrote and passes
your own RPN evaluator tests
Wrote and passes
your own evaluator tests
diagram showing where the Gregorian library classes integrate
into the system
||(10% total) 2% 2% 2% 4%||
|Penalties from C & C++ Grading Guide v2.2.0||various||
|Late submission One to five days late More than five days late||
entire Visual Studio project directory to Fanshawe Online
- Delete all debug and release directories.i
- Submit in a .ZIP, .7z archive file.