Observe the following C++ code and answer the questions (i) and (ii).
Note: Assume all necessary files are included
class TEST
{
long TCode ;
char TTitle[20];
float Score;
public:
TEST() //Member Function 1
{
TCode=100;strcpy(TTit1e,"FIRST Test"); Score=O;
};
TEST(TEST &T) //Member Function 2
{
TCode=E.TCode+1;
strcpy(TTitle , T.TTitle);
Score=T.Score;
}
};
void main()
{
__________ //Statement 1
__________ //Statement 2
}
1) Which Object-Oriented Programming feature is illustrated by the Member Function 1 and the Member Function 2 together in the class TEST?
2) Write Statement 1 and Statement 2 to execute Member Function 1 and Member Function 2 respectively.
Advertisement Remove all ads
This question doesn't have a solution currently. Please check again in a few days.
Notes
1) Data hiding and data encapsulation
2) Test T1;
Test T2(obj1);
Concept: Member of a Class - Data Members and Member Functions (Methods)
Is there an error in this question or solution?
Advertisement Remove all ads
APPEARS IN
Advertisement Remove all ads
Advertisement Remove all ads