Question: (a) Draw a class diagram representing the classes declared below (b) Declare these classes in a file entitled BinaryOperators.h, inserting appropriate pre-compilation directives. Define all

(a) Draw a class diagram representing the classes declared below (b) Declare these classes in a file entitled "BinaryOperators.h", inserting appropriate pre-compilation directives. Define all the non-abstract methods in a source file entitled "BinaryOperators.cpp". Include also the definition of the function Test0. In this function use polymorphism to compute the following: 3+7, 3-5, 3*7, 3/5, 3/0 (c) Define main() in a source file entitled "main.cpp". Call Test0 in main0 (d) Run you program and turn in the header files, source files, and the output of your program class Binaryoperator [ public: Binaryoperator double opl, double op2 virtual double DoOp const0 fopl opl fop2 op2) () protected: const double fopl; const double fop2; // class BinaryOperator class Adder public BinaryOperator i public: Adder double opl, double op2BinaryOperator opl, op2 virtual double DoOp const; // class Adder class Subtractor public BinaryOperator public: Subtractor double opl, double op2 virtual double DoOp const; BinaryOperator opl, op2) ) // class Subtractor class Multiplier public Binaryoperator [ public: Multiplier double opl, double op2 virtual double DoOp const : BinaryOperator opl, op2 I // class Multiplier class Divider public BinaryOperator t public: Divider double opl, double op2 virtual double DoOp const : BinaryOperator opl, op2 ) // class v void Test
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
