CSE 335 Homework 3Objectives:Implement class hierarchies using abstract classes and pure virtual functions.Description:In class, we discussed how to design a class hierarchy to implement arithmetic expres-sion trees. For this exercise, you are to implement these classes and add an operation to computethe value of an expression tree. For the first part, you will need to implement the concrete classes:Literalrepresents an integer literal in an expression (e.g., the “23” and the “3” in the expression23-3).Negateis a unary operator that changes the sign of another expression (e.g., in the expression-(23 + 4)the primary operator is negation).Add, Subtract, Multiply, and Divideare binary operators whose names should be self explana-tory.Initially, classLiteralshould merely provide an operation for returning its value, and the operatorclasses should provide operations for retrieving the expression or expressions upon which theyoperate.
This is the end of the preview.
access the rest of the document.