The code given below does not compile due to const issues. Modify the existing class code and add const in the appropriate locations to make it compile with the existing main and printNumber functions.
The code below has a class representing members of a family who all share a last name. (An idea that almost certainly wouldnβt make sense to use in a real program.) It is missing an initialization for the last name. Add the initialization statement for the last name so that the family members have the last name "Jones".
The code below has a class representing members of a family who all share a last name. (An idea that almost certainly wouldnβt make sense to use in a real program.) It is missing the lastName variable. Declare it and add the initialization statement so that the family members have the last name "Jones".
Add a getEnd function that returns the end point of the segment. It is assumed you will return a Point value. But you may also return a reference or a const reference if you prefer.
The Segment has a function minX() declared. Implement that function after the class declaration. (Donβt forget to use Segment:: when naming the function.). It should return the lowest x value from the two Points.
Write a moveBy(double dx, double dy) function that shifts a segment by the amount dy in the x dimension and dy in the y dimension. (To shift the segment, you will need to shift both endpoints.)
This code uses a simplified Point class that lacks a no-arg (default) constructor. Thus while constructing a Segment, we must use the initializer list to set up m_start and m_end. Add a 2-Point constructor that uses the initializer list.