Question: Problem 1 C++ HW Design a class named MyPoint to represent a point with x and y-coordinates. the class contains: a. Two data fields x
Problem 1 C++ HW
Design a class named MyPoint to represent a point with x and y-coordinates. the class contains: a. Two data fields x and y that represents the coordinates b. A no-arg constructor that creates a point (0,0) c. A constructor that constructs a point with specified coordinates d. The accessor and mutator functions for all the data fields e. A function named getDistance that returns the distance from this point to another point of the MyPoint type f. A function named getPoint that returns a string of x and y-coordinates of this point g. A function named getMidpoint that returns a string of x and y-coordinates of the calculated midpoint between this point to another point of the MyPoint type Implement the class. Write the following test program that created two points(0, 0) and (10, 30.5) and displays the distance between the midpoint between them.
Here is the shell of the code:
#include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
