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 people in a family who all share a last name. It implements the last name as a static class variable (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 defines a class Book. It includes a declaration for a member function isLonger. It should compare the number of pages in this book with another book and return true if this book has more pages.
The code below defines a class Book. It also defines a class Reader. Implement the member function readBook for the Reader class. It should add the title of the book to the readerβs history.
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.