Question: please help me get the correct code in C++ quickly and please show your output run time has to be less than 30 seconds and





Your task is to create a calculator library that allows the user to construct a graph of integer computations and evaluate them. Read through test.cpp to see how the library needs toJbe used, and implement it accordingly. "include "../src/calculator.hpp" I/ Test al1 functionality of the calculator, which is: If - Lit(i) to create literal expressions II - foo->Add(bar), foo->Sub(bar), foo->Mul(bar) to perform operations on two expressions II - foo->tostring() and foo->simplify() to display and evaluate calculator expressions TEST_CASE("Testing function - SumNumbers") \{ auto eq = [] (auto e, std: :string before, std::string after) \{ II Ensure the string representation matches expected value REQUIRE(e->toString() = before); // Ensure the string represtation after simplication matches expected value REQUIRE(e->simplify() ->tostring() = after); I/ simplify() should NOT change the original value REQUIRE(e->tostring() = before); 3; SECTION("testLiterals") \{ eq(Lit(2), "2", "2"); eq(Lit(-1), "-1", "-1"); SECTION("testadding") eq ( Lit(2) Add (Lit(3)),"(2+3),"5); eq ( Lit (1)Add(Lit(2))>Add(Lit(3)),"((1+2)+3)n,"6"); test.cpp calculator.cpp calculator.hpp \#include "calculator.hpp" II Insert code here
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
