Question: CMPS 370 Fall 2018 Assignment 3 (a) Draw a class diagram representing the classes declared below. (b) Declare these classes in a file entitled BinaryOperators.h,
CMPS 370 Fall 2018 Assignment 3 (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 TestO 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 BLnaryoperator public Binaryoperator double op, double op2 virtual double Doop o const const double Opl: : topl ( opl ), top2 lop2 ) protectedi const double rop2: 7 cless Binaryoperator class Adder: publie Binaryoperator public Adder double opi, double op2 virtual double DoOpconst Binaryoperator opl, op2 1/ elass Addes class Subtractor public Binaryoperator publie: Subtractor (double opl, double op2Binaryoperator opl. opz virtual double Doopconst 17 elass Subteacto class Maltiplier public Binaryoperator public Multiplier ( double opl, double op2Binaryoperator opl. op2 virtual double Doop 17 class iti oonst class Dividers pablic BinaryOperator public Divider double opl, double op2 virtual double Doop o const Binaryoperator opl, op2 77 elass v void Test
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
