Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
435 views
in Computer by (45.3k points)
closed by

Observe the following C++ code and answer the questions (i) and (ii). Note: Assume all necessary files are included. 

class FIRST 

int Num1; 

public: 

void Display () // Member Function1 

cout<< Num1<<end1;

}

 };

class SECOND : public FIRST 

int Num2; 

public: 

void Display () //Member Function2

cout<<Num2<<end1;

}; 

void main ()

SECOND S;

............... //Statement 1

 ............. //Statement 2

 }

(i) Which Object-Oriented Programming feature is illustrated by the definitions of classes FIRST and SECOND? 

(ii) Wife Statement 1 and Statement 2 to execute Member Function 1 and Member Function 2 respectively using the object S

1 Answer

+1 vote
by (50.9k points)
selected by
 
Best answer

(i) Inheritance is an Object Oriented Programming feature which is illustrated by the definitions of classes FIRST and SECOND. 

(ii) Statement1

S.FIRST :: Display();

Statement 2

S.SECOND :: Display();

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...