Question: Example Code: The example below demonstrates the aspects of constructor overloading, defining member functions outside the class, and most importantly objects as function arguments. This

Example Code: The example below demonstrates the aspects of constructor overloading, defining member functions outside the class, and most importantly objects as function arguments. This program starts with a distance dist2 set to an initial value and adds to it a distance dist1, whose value is supplied by the user, to obtain the sum of the distances. It then displays all three distances #include Tasks: 5.1. Code the example of complex class given above and include the functions for addition, subtraction and multiplication of objects of complex class and return the object containing result. Test all the functions in main. 5.2. Modify the above task such that; define the member function show() outside the class and also define it as inline. 5.3. Modify the task (5.1) by defining all the member functions outside the class definition. 5.4. Test the distance class example given above. Subject: Object Oriented Programming Programming Language: C++ Perform all the tasks. As I'm a beginner so please write simple and easy code as you can. Thank You!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
