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

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 can still be accessed by the main() function to produce the same output. Consider the C++ program given. The program consists of a class definition

// 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!