Please use c to solve Thank you so much Warmup Complete the

Please use c++ to solve. Thank you so much!

Warm-up Complete the following paper/pencil exercises and discuss your results with one of your TAs: 1) Consider the following class declaration: class Point {public: void showPoint() const; Point(); Point(int, int);  int xlocation; int ylocation;}    ; What does the const keyword signify in line 3? Which line contains the default constructor for the class? The data members are declared public. Will this work? Would this be a good idea or not for a large program? Write the function definition for the constructor declared in line 5

Solution

a) const keyword signifies that the function can only change the class members which are mutable. non mutable members cannot be changed in this function.

b) line 4 contains the default constructor.

c) Yes, it will work fine.

d) If data encapsulation is not required for the program than it does not matter whether class members are declared public or private and whether it is small or large program.

e)

Point::Point(int x,int y)
{
xlocation = x;
ylocation = y;
}

Please use c++ to solve. Thank you so much! Warm-up Complete the following paper/pencil exercises and discuss your results with one of your TAs: 1) Consider the

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site