Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Code is in C++ Write a SimpleCalculator class that has public methods for adding, subtracting, multiplying and dividing two doubles. A sample call is as
Code is in C++
Write a SimpleCalculator class that has public methods for adding, subtracting, multiplying and dividing two doubles. A sample call is as follows: double answer = scadd( a, b ); Object sc is of type SimpleCalculator. Member function add returns the result of adding its two Below is a sample output (with input shown here in red) The value of a is: 10 The value of b is: 20 Adding a and b yields 30 Subtracting b from a yields -10 Multiplying a by b yields 200 Dividing a by b yields 0.5 Separate your class definition from implementation. Your class definition must be stored in a file called "SimpleCalculator.h". Your class implementation must be stored in a file called "SimpleCalculator.cpp. You also need to provide your own test driver "lab5.cpp" to test all capabilities (i.e. adding, subtracting multiplying and dividing two doubles) of your SimpleCalculator class you will practice: Create a class definition Define member functions Write a test driver to demonstrate the capabilities of a classStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started