SlideShare a Scribd company logo
1 of 13
GET 100% MARKS IN
COMPUTER SCIENCE
TOPIC COVERED : QUESTION BASED ON
INHERITANCE
IN THIS PART 4 TYPE OF QUESTIONS CAN BE
FORMED IN YOUR EXAM
1. To Identify the type of inheritance in the given question
2. To identify the members accessible through an object
3. To identify the members accessible through a member function
4. To calculate size of any class
3 TERMS CAN BE USED IN THIS
TYPE OF QUESTION
DATA MEMBERS MEMBER
FUNCTIONS/METHODS
MEMBERS
DATA MEMBERS REFERS TO
THE VARABLES DECARED
WITHIN CLASS
MEMBER
FUNCTION/METHOD REFERS
TO THE FUNCTION WITHIN
CLASS
MEMBERS REFERS TO BOTH
VARABLES AND FUNCTIONS
DECARED WITHIN CLASS
Q.1 IDENTIFY TYPE OF INHERITANCE
TYPES OF INHERITANCE IN C++ ARE
1.) SINGLE
2.) MULTIPLE
3.) MULTILEVEL
4.) HIERARICHAL
5.) HYBRID
LET’S UNDERSTAND TYPE OF INHERITANCE THROUGH THE MEAN
OF DIAGRAMS
BASE/PARENT/
SUPER CLASS
CHILD/DERIVE
D/SUB CLASS
SINGLE INHERITANCE
BASE/PARENT/
SUPER CLASS
BASE/PARENT/
SUPER CLASS
CHILD/DERIVE
D/SUB CLASS
MULTIPLE INHERITANCE
BASE/PARENT/
SUPER CLASS
CHILD/DERIVE
D/SUB CLASS
CHILD/DERIVE
D/SUB CLASS
HIERARICHAL INHERITANCE
BASE/PARENT/
SUPER CLASS
CHILD/DERIVE
D/SUB CLASS
CHILD/DERIVE
D/SUB CLASS
MULTILEVEL INHERITANCE
BASE/PARENT/
SUPER CLASS
BASE/PARENT/
SUPER CLASS
CHILD/DERIVE
D/SUB CLASS
CHILD/DERIVE
D/SUB CLASS
CHILD/DERIVE
D/SUB CLASS
HYBRID INHERITANCE
Q.2TO IDENTIFY THE MEMBERS ACCESSIBLE THROUGH AN OB
RULES TO SOLUTION
RULE 1: AN OBJECT CAN ACCESS ONLY PUBLIC MEMBERS OF ITS OWN CLASS.
RULE 2 : AN OBJECT CAN ACCESS PUBLIC MEMBERS OF IT’S PARENT/SUPER CLASS
BUT THE MODE OF INHERITANCE SHOULD BE PUBLIC ONLY.
Q.3.TO IDENTIFY THE MEMBERS ACCESSIBLE THROUGH A
MEMBER FUNCTION
RULES TO SOLVE IT EASILY
RULE 1: A MEMBER FUNCTION CAN ACCESS ALL MEMVERS/DATA OF ITS OWN
CLASS.
RULE 2 : A MEMBERS FUNCTION CAN ACCESS ONLY PUBLIC AND PROTECTED OF
SUPER/PARENT CLASS IN ANY MODE OF INHERITANCE.
Q.4. CALCULATE SIZE OF A CLASS
• SIZE OF ANY CLASS = SIZE OF THAT CLASS + SIZE OF ITS PARENT CLASSES
• TO CALCULATE SIZE OF ANY PARTICULAR CLASS JUST ADD SIZE OF ALL IT’S
DATA MEMBERS
SIZE OF SOME DATA TYPES
INTEGER : 2 BYTES
CHARACTER : 1 BYTE
FLOAT : 4 BYTES
LONG : 8 BYTES
DOUBLE : 8 BYTES
Note: You have to count size of all data
members(variables) including public,
private and protected section variables.
CLASS A
CLASS B
CLASS C
SIZE OF CLASS
A ONLY
SIZE OF CLASS B
+
SIZE OF CLASS A
SIZE OF CLASS B
+
SIZE OF CLASS A
+
SIZE OF CLASS C
CLASS A CLASS B
CLASS C
SIZE OF CLASS
A ONLY
SIZE OF CLASS
B ONLY
SIZE OF CLASS B
+
SIZE OF CLASS A
+
SIZE OF CLASS C
CLASS A
CLASS B CLASS C
SIZE OF CLASS
A ONLY
SIZE OF CLASS B
+
SIZE OF CLASS A
SIZE OF CLASS C
+
SIZE OF CLASS A
THANKS FOR WATCHING MY PPT
AND PLEASE DON’T FORGOT TO LIKE
SUBSCRIBE AND DO COMMENTS IF YOU HAVE
ANY QUERY AND IF YOU LIKE THE PPT
EMAIL : theaakashkumar@gmail.com

More Related Content

Similar to Inheritance question

Seminar on java
Seminar on javaSeminar on java
Seminar on javashathika
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++Vineeta Garg
 
School Software Students information
School Software Students informationSchool Software Students information
School Software Students informationRanganath Shivaram
 
1 ASSIGNMENT 1 REVIEWING RESEARCH AND MAKIN.docx
1  ASSIGNMENT 1   REVIEWING RESEARCH AND MAKIN.docx1  ASSIGNMENT 1   REVIEWING RESEARCH AND MAKIN.docx
1 ASSIGNMENT 1 REVIEWING RESEARCH AND MAKIN.docxoswald1horne84988
 
Part AExplain why access modifiers are necessary for any class b.docx
Part AExplain why access modifiers are necessary for any class b.docxPart AExplain why access modifiers are necessary for any class b.docx
Part AExplain why access modifiers are necessary for any class b.docxherbertwilson5999
 
Student Records System SRS – Requirements DefinitionsNon.docx
Student Records System SRS – Requirements DefinitionsNon.docxStudent Records System SRS – Requirements DefinitionsNon.docx
Student Records System SRS – Requirements DefinitionsNon.docxhanneloremccaffery
 
Curriculum evaluation through learning assessment
Curriculum evaluation through learning assessmentCurriculum evaluation through learning assessment
Curriculum evaluation through learning assessmentRubioRichard1
 
LearnersThis announcement item concerns discussions activity .docx
LearnersThis announcement item concerns discussions activity .docxLearnersThis announcement item concerns discussions activity .docx
LearnersThis announcement item concerns discussions activity .docxSHIVA101531
 
Bridging the gap between closed and open items or how to make CALL more intel...
Bridging the gap between closed and open items or how to make CALL more intel...Bridging the gap between closed and open items or how to make CALL more intel...
Bridging the gap between closed and open items or how to make CALL more intel...bwylin
 
Inheritance in C++
Inheritance in C++Inheritance in C++
Inheritance in C++RAJ KUMAR
 
2. week 2 data presentation and organization
2. week 2 data presentation and organization2. week 2 data presentation and organization
2. week 2 data presentation and organizationrenz50
 
Questions 1 9 (all answers must be placed on separate answ
Questions 1 9 (all answers must be placed on separate answQuestions 1 9 (all answers must be placed on separate answ
Questions 1 9 (all answers must be placed on separate answYASHU40
 

Similar to Inheritance question (16)

Seminar on java
Seminar on javaSeminar on java
Seminar on java
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++
 
School Software Students information
School Software Students informationSchool Software Students information
School Software Students information
 
1 ASSIGNMENT 1 REVIEWING RESEARCH AND MAKIN.docx
1  ASSIGNMENT 1   REVIEWING RESEARCH AND MAKIN.docx1  ASSIGNMENT 1   REVIEWING RESEARCH AND MAKIN.docx
1 ASSIGNMENT 1 REVIEWING RESEARCH AND MAKIN.docx
 
Part AExplain why access modifiers are necessary for any class b.docx
Part AExplain why access modifiers are necessary for any class b.docxPart AExplain why access modifiers are necessary for any class b.docx
Part AExplain why access modifiers are necessary for any class b.docx
 
Student Records System SRS – Requirements DefinitionsNon.docx
Student Records System SRS – Requirements DefinitionsNon.docxStudent Records System SRS – Requirements DefinitionsNon.docx
Student Records System SRS – Requirements DefinitionsNon.docx
 
Curriculum evaluation through learning assessment
Curriculum evaluation through learning assessmentCurriculum evaluation through learning assessment
Curriculum evaluation through learning assessment
 
LearnersThis announcement item concerns discussions activity .docx
LearnersThis announcement item concerns discussions activity .docxLearnersThis announcement item concerns discussions activity .docx
LearnersThis announcement item concerns discussions activity .docx
 
11 Inheritance.ppt
11 Inheritance.ppt11 Inheritance.ppt
11 Inheritance.ppt
 
Inheritance.pptx
Inheritance.pptxInheritance.pptx
Inheritance.pptx
 
On the ecological validity of a password study
On the ecological validity of a password studyOn the ecological validity of a password study
On the ecological validity of a password study
 
Bridging the gap between closed and open items or how to make CALL more intel...
Bridging the gap between closed and open items or how to make CALL more intel...Bridging the gap between closed and open items or how to make CALL more intel...
Bridging the gap between closed and open items or how to make CALL more intel...
 
Inheritance in C++
Inheritance in C++Inheritance in C++
Inheritance in C++
 
2. week 2 data presentation and organization
2. week 2 data presentation and organization2. week 2 data presentation and organization
2. week 2 data presentation and organization
 
Questions 1 9 (all answers must be placed on separate answ
Questions 1 9 (all answers must be placed on separate answQuestions 1 9 (all answers must be placed on separate answ
Questions 1 9 (all answers must be placed on separate answ
 
Chapter 7 ooad
Chapter 7 ooadChapter 7 ooad
Chapter 7 ooad
 

More from AAKASH KUMAR

NETWORKING AND COMMUNICATION || SLIDE 1 || TOPOLOGY AND PLACEMENT OF DEVICES|...
NETWORKING AND COMMUNICATION || SLIDE 1 || TOPOLOGY AND PLACEMENT OF DEVICES|...NETWORKING AND COMMUNICATION || SLIDE 1 || TOPOLOGY AND PLACEMENT OF DEVICES|...
NETWORKING AND COMMUNICATION || SLIDE 1 || TOPOLOGY AND PLACEMENT OF DEVICES|...AAKASH KUMAR
 
2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CSAAKASH KUMAR
 
Header file BASED QUESTION- CBSE CS CLASS 12TH
Header file BASED QUESTION- CBSE CS CLASS 12THHeader file BASED QUESTION- CBSE CS CLASS 12TH
Header file BASED QUESTION- CBSE CS CLASS 12THAAKASH KUMAR
 
Constructor & destructor based question- cbse cs class 12th
Constructor & destructor based question-  cbse cs class 12thConstructor & destructor based question-  cbse cs class 12th
Constructor & destructor based question- cbse cs class 12thAAKASH KUMAR
 
CHOOSE THE CORRECT IDENTIFIER - Q.1 CBSE CS EXAM
CHOOSE THE CORRECT IDENTIFIER - Q.1 CBSE CS EXAMCHOOSE THE CORRECT IDENTIFIER - Q.1 CBSE CS EXAM
CHOOSE THE CORRECT IDENTIFIER - Q.1 CBSE CS EXAMAAKASH KUMAR
 
Practical exam special- CBSE CS CLASS 12th
Practical exam special- CBSE CS CLASS 12thPractical exam special- CBSE CS CLASS 12th
Practical exam special- CBSE CS CLASS 12thAAKASH KUMAR
 
2 d array(part 1) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 1) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS2 d array(part 1) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 1) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CSAAKASH KUMAR
 
STACK || FUNCTION WRITING BASED ON STACK || DATA STRUCTURE || LINKED LIST || ...
STACK || FUNCTION WRITING BASED ON STACK || DATA STRUCTURE || LINKED LIST || ...STACK || FUNCTION WRITING BASED ON STACK || DATA STRUCTURE || LINKED LIST || ...
STACK || FUNCTION WRITING BASED ON STACK || DATA STRUCTURE || LINKED LIST || ...AAKASH KUMAR
 
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...AAKASH KUMAR
 
Inheritance question class 12th
Inheritance question class 12thInheritance question class 12th
Inheritance question class 12thAAKASH KUMAR
 
Power point2007instruction
Power point2007instructionPower point2007instruction
Power point2007instructionAAKASH KUMAR
 
Html introduction Part-2
Html introduction Part-2Html introduction Part-2
Html introduction Part-2AAKASH KUMAR
 
Evolution / history of Computer
Evolution / history of ComputerEvolution / history of Computer
Evolution / history of ComputerAAKASH KUMAR
 
Array within a class
Array within a classArray within a class
Array within a classAAKASH KUMAR
 
Input Output Devices and Memory Unit
Input Output Devices and Memory UnitInput Output Devices and Memory Unit
Input Output Devices and Memory UnitAAKASH KUMAR
 
C++ programming Unit 5 flow of control
C++ programming Unit 5 flow of controlC++ programming Unit 5 flow of control
C++ programming Unit 5 flow of controlAAKASH KUMAR
 

More from AAKASH KUMAR (20)

NETWORKING AND COMMUNICATION || SLIDE 1 || TOPOLOGY AND PLACEMENT OF DEVICES|...
NETWORKING AND COMMUNICATION || SLIDE 1 || TOPOLOGY AND PLACEMENT OF DEVICES|...NETWORKING AND COMMUNICATION || SLIDE 1 || TOPOLOGY AND PLACEMENT OF DEVICES|...
NETWORKING AND COMMUNICATION || SLIDE 1 || TOPOLOGY AND PLACEMENT OF DEVICES|...
 
2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
 
Header file BASED QUESTION- CBSE CS CLASS 12TH
Header file BASED QUESTION- CBSE CS CLASS 12THHeader file BASED QUESTION- CBSE CS CLASS 12TH
Header file BASED QUESTION- CBSE CS CLASS 12TH
 
Constructor & destructor based question- cbse cs class 12th
Constructor & destructor based question-  cbse cs class 12thConstructor & destructor based question-  cbse cs class 12th
Constructor & destructor based question- cbse cs class 12th
 
CHOOSE THE CORRECT IDENTIFIER - Q.1 CBSE CS EXAM
CHOOSE THE CORRECT IDENTIFIER - Q.1 CBSE CS EXAMCHOOSE THE CORRECT IDENTIFIER - Q.1 CBSE CS EXAM
CHOOSE THE CORRECT IDENTIFIER - Q.1 CBSE CS EXAM
 
Practical exam special- CBSE CS CLASS 12th
Practical exam special- CBSE CS CLASS 12thPractical exam special- CBSE CS CLASS 12th
Practical exam special- CBSE CS CLASS 12th
 
2 d array(part 1) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 1) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS2 d array(part 1) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 1) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
 
STACK || FUNCTION WRITING BASED ON STACK || DATA STRUCTURE || LINKED LIST || ...
STACK || FUNCTION WRITING BASED ON STACK || DATA STRUCTURE || LINKED LIST || ...STACK || FUNCTION WRITING BASED ON STACK || DATA STRUCTURE || LINKED LIST || ...
STACK || FUNCTION WRITING BASED ON STACK || DATA STRUCTURE || LINKED LIST || ...
 
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
 
Inheritance question class 12th
Inheritance question class 12thInheritance question class 12th
Inheritance question class 12th
 
Ms word Part 2
Ms  word Part 2Ms  word Part 2
Ms word Part 2
 
Ms word Part 1
Ms  word Part 1Ms  word Part 1
Ms word Part 1
 
Power point2007instruction
Power point2007instructionPower point2007instruction
Power point2007instruction
 
Html introduction Part-2
Html introduction Part-2Html introduction Part-2
Html introduction Part-2
 
Html Slide Part-1
Html Slide Part-1Html Slide Part-1
Html Slide Part-1
 
Evolution / history of Computer
Evolution / history of ComputerEvolution / history of Computer
Evolution / history of Computer
 
computer system
computer system computer system
computer system
 
Array within a class
Array within a classArray within a class
Array within a class
 
Input Output Devices and Memory Unit
Input Output Devices and Memory UnitInput Output Devices and Memory Unit
Input Output Devices and Memory Unit
 
C++ programming Unit 5 flow of control
C++ programming Unit 5 flow of controlC++ programming Unit 5 flow of control
C++ programming Unit 5 flow of control
 

Recently uploaded

How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 

Recently uploaded (20)

How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 

Inheritance question

  • 1.
  • 2. GET 100% MARKS IN COMPUTER SCIENCE TOPIC COVERED : QUESTION BASED ON INHERITANCE
  • 3. IN THIS PART 4 TYPE OF QUESTIONS CAN BE FORMED IN YOUR EXAM 1. To Identify the type of inheritance in the given question 2. To identify the members accessible through an object 3. To identify the members accessible through a member function 4. To calculate size of any class
  • 4. 3 TERMS CAN BE USED IN THIS TYPE OF QUESTION DATA MEMBERS MEMBER FUNCTIONS/METHODS MEMBERS DATA MEMBERS REFERS TO THE VARABLES DECARED WITHIN CLASS MEMBER FUNCTION/METHOD REFERS TO THE FUNCTION WITHIN CLASS MEMBERS REFERS TO BOTH VARABLES AND FUNCTIONS DECARED WITHIN CLASS
  • 5. Q.1 IDENTIFY TYPE OF INHERITANCE TYPES OF INHERITANCE IN C++ ARE 1.) SINGLE 2.) MULTIPLE 3.) MULTILEVEL 4.) HIERARICHAL 5.) HYBRID
  • 6. LET’S UNDERSTAND TYPE OF INHERITANCE THROUGH THE MEAN OF DIAGRAMS BASE/PARENT/ SUPER CLASS CHILD/DERIVE D/SUB CLASS SINGLE INHERITANCE BASE/PARENT/ SUPER CLASS BASE/PARENT/ SUPER CLASS CHILD/DERIVE D/SUB CLASS MULTIPLE INHERITANCE BASE/PARENT/ SUPER CLASS CHILD/DERIVE D/SUB CLASS CHILD/DERIVE D/SUB CLASS HIERARICHAL INHERITANCE
  • 7. BASE/PARENT/ SUPER CLASS CHILD/DERIVE D/SUB CLASS CHILD/DERIVE D/SUB CLASS MULTILEVEL INHERITANCE BASE/PARENT/ SUPER CLASS BASE/PARENT/ SUPER CLASS CHILD/DERIVE D/SUB CLASS CHILD/DERIVE D/SUB CLASS CHILD/DERIVE D/SUB CLASS HYBRID INHERITANCE
  • 8. Q.2TO IDENTIFY THE MEMBERS ACCESSIBLE THROUGH AN OB RULES TO SOLUTION RULE 1: AN OBJECT CAN ACCESS ONLY PUBLIC MEMBERS OF ITS OWN CLASS. RULE 2 : AN OBJECT CAN ACCESS PUBLIC MEMBERS OF IT’S PARENT/SUPER CLASS BUT THE MODE OF INHERITANCE SHOULD BE PUBLIC ONLY.
  • 9. Q.3.TO IDENTIFY THE MEMBERS ACCESSIBLE THROUGH A MEMBER FUNCTION RULES TO SOLVE IT EASILY RULE 1: A MEMBER FUNCTION CAN ACCESS ALL MEMVERS/DATA OF ITS OWN CLASS. RULE 2 : A MEMBERS FUNCTION CAN ACCESS ONLY PUBLIC AND PROTECTED OF SUPER/PARENT CLASS IN ANY MODE OF INHERITANCE.
  • 10. Q.4. CALCULATE SIZE OF A CLASS • SIZE OF ANY CLASS = SIZE OF THAT CLASS + SIZE OF ITS PARENT CLASSES • TO CALCULATE SIZE OF ANY PARTICULAR CLASS JUST ADD SIZE OF ALL IT’S DATA MEMBERS SIZE OF SOME DATA TYPES INTEGER : 2 BYTES CHARACTER : 1 BYTE FLOAT : 4 BYTES LONG : 8 BYTES DOUBLE : 8 BYTES Note: You have to count size of all data members(variables) including public, private and protected section variables.
  • 11. CLASS A CLASS B CLASS C SIZE OF CLASS A ONLY SIZE OF CLASS B + SIZE OF CLASS A SIZE OF CLASS B + SIZE OF CLASS A + SIZE OF CLASS C CLASS A CLASS B CLASS C SIZE OF CLASS A ONLY SIZE OF CLASS B ONLY SIZE OF CLASS B + SIZE OF CLASS A + SIZE OF CLASS C
  • 12. CLASS A CLASS B CLASS C SIZE OF CLASS A ONLY SIZE OF CLASS B + SIZE OF CLASS A SIZE OF CLASS C + SIZE OF CLASS A
  • 13. THANKS FOR WATCHING MY PPT AND PLEASE DON’T FORGOT TO LIKE SUBSCRIBE AND DO COMMENTS IF YOU HAVE ANY QUERY AND IF YOU LIKE THE PPT EMAIL : theaakashkumar@gmail.com