Question: Computer Science c++ class Op: This class represents the operands in an expression, and can be any double value . Its string representation should be

Computer Science

c++

class Op: This class represents the operands in an expression,and can be any double value. Its string representation should be a string version of its double value.

Create op.cpp file

don't just change return0.0; to 8

to make pass thetest

Computer Sciencec++class Op: This class represents the operands in an expression,and canbe any double value. Its string representation should be a string versionof its double value.Create op.cpp filedon't just change return0.0; to 8to makepass thetest m FAILED ] OpTest . OpEvaluateNonZero (1 ms) 1 testfrom OpTest (1 ms total) Global test environment tear-down 1 test from

m FAILED ] OpTest . OpEvaluateNonZero (1 ms) 1 test from OpTest (1 ms total) Global test environment tear-down 1 test from 1 test suite ran. (1 ms total) PASSED 0 tests. L FAILED 1 test, listed below: L FAILED OpTest . OpEvaluateNonZero\f\f1 #ifndef OP HPP 2 #define OP HPP 3 4 #include "base. hpp" 5 6 class Op : public Base { 7 public: 8 Op (double value) : Base() { } 9 virtual double evaluate() { return 0.0; } 10 virtual std: :string stringify() { return ""; } 11 12 13 #endif / / OP HPP#itndef BASE HPP #define BASE HPP #include class Base { public: /* Constructors */ Base() { }; /* Pure Virtual Functions */ virtual double evaluate() = 0; virtual std: :string stringify() = 0; #endif / / BASE HPP

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!