A hierarchy of arithmetic expressions using virtual functions and inheritance. Expressions are either multiplication, addition, absolute value, square, or just an integer value. Expressions can be printed and evaluated. A description is given in the "description.pdf" file provided.
Implementation of the methods are in the file Expression.cpp.
The signatures of the classes and their methods are given in the header file Expression.h.
The file main.cpp includes a basic usage of the expressions.
The provided makefile will attempt to build the main file.
- Expression.h
- Expression.cpp
- main.cpp
- makefile
- Tester.h
- Tester.cpp
- TestPart2.cpp The makefile will attempt to build the file TestPart2 which can be used to test the program. The way to execute the tests (with options a to v) is:
./TestPart2 a
./TestPart2 b
...