Question: oop 1. Write the declaration for class B. The class's members should be as follows: - m : an integer. This should not be accessible

oop
1. Write the declaration for class B. The class's members should be as follows: - m : an integer. This should not be accessible to code outside the class or to member functions in any class that is derived from class B. - n : an integer. This should not be accessible to code outside the class but should be accessible to member functions in any class that is derived from class B. - setN, getN, SetM, and getM: These are the set and get functions for the member variables m and n. These should be accessible to the code outside the class. - calc: a public member function that returns the value of m times n. Next, write the declaration of class D, which is derived from class B. The class's members should be as follows: - q: a float. This variable should not be accessible to the code outside the class but should be accessible to member functions in any class derived from class D. - r: a float. This variable should not be accessible to the code outside the class but should be accessible to member functions in any class derived from class D. - setQ, getQ, setR, and getR: These are the set and get functions for the member variables m and n. These should be accessible to the code outside the class. - calc: public member function that overrides the base calc function. This should return the value of r times
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
