Create a simple C++ program to instantiate an object that will store two numbers and perform mathematical operations using those numbers as operands. The class should have a header called Adder.h and a .cpp file called Adder.cpp. Testing should be done in a separate .cpp file called main.cpp. The class should have at least two constructors. The default constructor should instantiate both operands to 2. A second constructor should accept two numbers as arguments and use the arguments to set the local operands. The class should have 6 functions: add(), subtract(), multiply(), divide(), get(), and set(). The first four functions should return the result of performing the stated operations using the two operands and take no arguments. Get() should take one argument to specify which operand to return. Set() should take two arguments, the first to specify which operand to set and the second to specify the number to set the operand equal to. Your code should document each function, and the class, with comments.
The Solutions provided are Correct, Plagiarism-Free and Success Guaranteed.
Broad Range of subjects
We support more than 100 fields with various subjects.
All major payment methods are supported.
Edulissy is not sponsored or endorsed by any college or university. The solutions have been Answered & Solved in accordance with the appropriate policies of Edulissy Consultancies. For more Info. contact Support@edulissy.com.