Question: Consider the C++ program given. The program consists of a class definition with 'unprotected' data. Rewrite the program such that the data are 'protected' but
// Object oriented program for question 3 (c) (iv) \#include using namespace std; class CLA \{ public: float DAT; private: SET(float x) \{ DAT=x \} float GETO \{ return(DAT); \} 3 maino \{ CLA OBJ; float NUM =0.0; cout NUM; OBJ DAT = NUM; NUM =0.0; cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
