Question: c++ Question) Create a class to hold distances as meters. a) Write the necessary class definition including constructors and set/get methods. b) Write a regular
c++

Question) Create a class to hold distances as meters. a) Write the necessary class definition including constructors and set/get methods. b) Write a regular function called mathMult(...) that takes a distance object as a parameter and modifies it where the distance is multiplied by two and returns it. c) Write the main function. In the main function create a distance object, set its value to 2m and pass it to the function above to multiply the distance by two and print the result in the main. NOTE: You have to think about how to pass the object to the function (by value, by reference or using a pointer). Choose the method that fits to the
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
