CBSE Class 12 Computer Science Inheritance Extending Classes Worksheet

Read and download free pdf of CBSE Class 12 Computer Science Inheritance Extending Classes Worksheet. Students and teachers of Class 12 Computer Science can get free printable Worksheets for Class 12 Computer Science Inheritance Extending Classes in PDF format prepared as per the latest syllabus and examination pattern in your schools. Class 12 students should practice questions and answers given here for Computer Science in Class 12 which will help them to improve your knowledge of all important chapters and its topics. Students should also download free pdf of Class 12 Computer Science Worksheets prepared by teachers as per the latest Computer Science books and syllabus issued this academic year and solve important problems with solutions on daily basis to get more score in school exams and tests

Worksheet for Class 12 Computer Science Inheritance Extending Classes

Class 12 Computer Science students should refer to the following printable worksheet in Pdf for Inheritance Extending Classes in Class 12. This test paper with questions and answers for Class 12 will be very useful for exams and help you to score good marks

Class 12 Computer Science Worksheet for Inheritance Extending Classes

Inheritance

Inheritance is the process of creating a new class from existing class/classes. The existing class is known as the base/super/parent class and newly created class is known as derived/sub/child class. The derived class will inherits the properties of base class. Advantages of Inheritance are given below:

Reusability: It helps the code to be reused in derived class. The base class is defined and once it is compiled, it needs not to be reworked.

Transitivity: If class B inherits properties of another class A, then all subclasses of class B will automatically inherits the properties of A. It is called transitive property.

Types of Inheritance:

1. Single inheritance:- When a sub class inherits only from one base class, is known as single inheritance.

2. Multiple Inheritance:- When a sub class inherits from multiple base classes, is known as multiple inheritance.

3. Hierarchical Inheritance:- When many sub classes inherit from a single class, it is known as hierarchical inheritance.

4. Multilevel Inheritance:-When a class inherit from a class that itself inherits from another class it is known as a multilevel inheritance.

5. Hybrid Inheritance: It is a combination of 2 or more of above types of inheritance. There is no pattern of deriving from classes.

Class_12_Computer Science_Worksheet_6 

Q1. What is Inheritance ?
Answer . It is a special feature of OOPS. Inheritance is capability to inherit the properties of one class in to another class.
The derive new class is called derived class (sub class) and old class is called based class (super class).

The Class whose properties of data members are inherited, is called Base Class or Super Class and the class that inherits these properties, is called Derived Class or Sub Class. 
Exp1:- If Class A inherits the data of Class B then we can say A is Sub Class and B is super class.

Class_12_Computer_Science _Worksheet_4

5. Hybrid Inheritance
It is combination of two or more forms of inheritance.

Q2. What do you mean by Base and Derived Class ?
Answer . A derived class (or sub class) has to identify the class from which it is derived i.e. its base class (or super class)
class derived-class-name : visibility-mode base-class-name
{
              members of derived class;
};
class is a key word and visibility mode is a access speicifier (i.e. public, private or protected), : (colon) is used separation
colon (:) indicates derived class (sub class) is based on base class( super class)
Example
             class car : public automobile
             {
             members
             };

Q3. What is Multiple Inheritance ?
Answer . Multiple Inheritance means deriving a class from more than one base class.
Class kvschool
      {
             int rollno1;
             void num1();
Public:
             {
             float kvroll;
             void num2();
      };
class kvstud
      {
             int rollno2
             void num3();
Protected:
             float kvroll1;
             void num4();
      };
class kvclass : public kvschool, public kvstud
      {
             int kvroll2;
protected:
             void display();
      };
// to complete the program deifine display () – in class kvclass
             i.e. kvclass ::display()

Q4. Define the needs and objectives of Inheritance.
Answer . The major needs and objectives of inheritance are:
(i) It ensures the closeness with the real world models.
(ii) It extend the functionality of an existing class.
(iii) It establishes “a kind of” relationship.
(iv) It helps in reuse of an existing class by a subclass (reusability).
(v) It implements transitive nature( if a class Y inherits properties from class X, then all subclassY will automatically inherit the properties of X)
(vi) The redundancy can be reduced by abstracting a super class from few sub classes.
(vii) It is conept of reusability.

Q5. Give the following definitions, answer the questions that follow:-
#include <iostream.h>
class book
{
char title[20];
char author[20];
int noof pages;
public:
      void read();
      void show();
};
class textbook: private textbook
{
int noofchapters, noof assignments;
protected:
int standard;
void readtextbook();
void showtextbook();
};
class physicsbook: public textbook
{
char topic[20];
public:
void readphysicsbook();
void showphysicsbook();
};
(i) Name the members, which can be accessed from the member functions of class physicsbook.
(ii) Name the members, which can be accessed by an object of Class textbook.
(iii) Name the members, which can be accessed by an object of Class physicsbook.
(iv) What will be the size of an object (in bytes) of class physicsbook.
Answer . (i) standard , readtextbook(),showtextbook() and topic;
(ii) readtextbook() and showtextbook()
(iii) readphysicsbook(), showphysicsbook(), readtextbook() and showtextbook()
(iv) The size of object of physicsbook= size of book + size of Textbook + size of physicsbook.
= 42+6+20 = 68 bytes

Q6. Consider the following declarations and answer the questions given below:
Class vehicle
{
int wheels;
protected:
int passenger;
public:
void inputdata( int, int);
void outputdata();
};
class heavyvehicle: protected vehicle
{
int dieselpetrol;
protected:
int load;
public:
void readdata( int, int);
void writedata();
};
class bus:private heavyvehicle
{
char marks[20];
public:
void fetchdata(char);
void displaydata();
};
(i) Name the class and derived class of the class heavyvehicle.
(ii) Name the data members that can be accessed from function displaydata()
(iii) Name the data members that can be accessed by an object of bus class
(iv) Is the member function outputdata() accessible to the objects of heavyvehicle class.
Answer .(i) base class = vehicle, derived class = bus
(ii) The data members passenger, load, make are available to function display data
(iii) No data members can be accessed by the object of bus calss.
(iv) No member functions outputdata () is not accessible to the objects of heavy vehicle class.

Q7 . What type of C++ class members ( data members and member functions) are not inherited?
Answer . Data member : Static data members of the base class are not inherited by the derived class
Member functions: Constructors and destructors of base class are not inherited

More Worksheets for Class 12 Computer Science
CBSE Class 12 Computer Science Arrays Stacks Queues And Linked List Worksheet Set A
CBSE Class 12 Computer Science Arrays Stacks Queues And Linked List Worksheet Set B
CBSE Class 12 Computer Science Arrays Worksheet
CBSE Class 12 Computer Science Boolean Algebra Worksheet Set A
CBSE Class 12 Computer Science Boolean Algebra Worksheet Set B
CBSE Class 12 Computer Science C++ Programming Worksheet
CBSE Class 12 Computer Science Case Study Based Questions
CBSE Class 12 Computer Science Class And Objects Worksheet Set A
CBSE Class 12 Computer Science Class And Objects Worksheet Set B
CBSE Class 12 Computer Science Classes Objects Constructors And Destructors Worksheet
CBSE Class 12 Computer Science Communication And Network Concepts Worksheet
CBSE Class 12 Computer Science Computer Networking Worksheet
CBSE Class 12 Computer Science Constructors And Destructors Worksheet
CBSE Class 12 Computer Science Data File Handling Worksheet
CBSE Class 12 Computer Science Database Concepts And Sql Worksheet
CBSE Class 12 Computer Science Dbms And Structured Query Language Worksheet
CBSE Class 12 Computer Science Flow Of Control Worksheet
CBSE Class 12 Computer Science Function Overloading Worksheet
CBSE Class 12 Computer Science Function And Structures Worksheet
CBSE Class 12 Computer Science Fundamentals Of Computer Worksheet
CBSE Class 12 Computer Science Inheritance Extending Classes Worksheet
CBSE Class 12 Computer Science Linked Lists Stacks And Queues Worksheet
CBSE Class 12 Computer Science Network And Communication Technology Worksheet
CBSE Class 12 Computer Science Object Oriented Programming In C++ Worksheet
CBSE Class 12 Computer Science Object Oriented Programming Worksheet
CBSE Class 12 Computer Science Oop Classes And Objects Worksheet
CBSE Class 12 Computer Science Pointer Worksheet
CBSE Class 12 Computer Science Program List Worksheet
CBSE Class 12 Computer Science Programming In C++ Worksheet
CBSE Class 12 Computer Science Revision Worksheet Set A
CBSE Class 12 Computer Science Revision Worksheet Set B
CBSE Class 12 Computer Science Revision Worksheet Set C
CBSE Class 12 Computer Science SQL Worksheet Set A
CBSE Class 12 Computer Science SQL Worksheet Set B
CBSE Class 12 Computer Science Stacks Queues And Linked List Worksheet
CBSE Class 12 Computer Science Sure Shot Questions Worksheet Set A
CBSE Class 12 Computer Science Sure Shot Questions Worksheet Set B
CBSE Class 12 Computer Science Sure Shot Questions Worksheet Set C
CBSE Class 12 Computer Science Sure Shot Questions Worksheet Set D
CBSE Class 12 Computer Science Text Files Worksheet
CBSE Class 12 Computers Boolean Algebra Worksheet
CBSE Class 12 Computers Classes And Objects Worksheet
CBSE Class 12 Computers Constructors And Destructors Worksheet
CBSE Class 12 Computers Data Structures Worksheet
CBSE Class 12 Computers Files Worksheet
CBSE Class 12 Computers Inheritance Worksheet
CBSE Class 12 Computers Networking Worksheet
CBSE Class 12 Computers Object Oriented Programming Worksheet
CBSE Class 12 Computers Pointers Worksheet

Worksheet for CBSE Computer Science Class 12 Inheritance Extending Classes

We hope students liked the above worksheet for Inheritance Extending Classes designed as per the latest syllabus for Class 12 Computer Science released by CBSE. Students of Class 12 should download in Pdf format and practice the questions and solutions given in the above worksheet for Class 12 Computer Science on a daily basis. All the latest worksheets with answers have been developed for Computer Science by referring to the most important and regularly asked topics that the students should learn and practice to get better scores in their class tests and examinations. Expert teachers of studiestoday have referred to the NCERT book for Class 12 Computer Science to develop the Computer Science Class 12 worksheet. After solving the questions given in the worksheet which have been developed as per the latest course books also refer to the NCERT solutions for Class 12 Computer Science designed by our teachers. We have also provided a lot of MCQ questions for Class 12 Computer Science in the worksheet so that you can solve questions relating to all topics given in each chapter.

Where can I download latest CBSE Printable worksheets for Class 12 Computer Science Inheritance Extending Classes

You can download the CBSE Printable worksheets for Class 12 Computer Science Inheritance Extending Classes for latest session from StudiesToday.com

Is there any charge for the Printable worksheets for Class 12 Computer Science Inheritance Extending Classes

There is no charge for the Printable worksheets for Class 12 CBSE Computer Science Inheritance Extending Classes you can download everything free

Are there any websites that offer free test sheets for Class 12 Computer Science Inheritance Extending Classes

Yes, studiestoday.com provides all latest NCERT Inheritance Extending Classes Class 12 Computer Science test sheets with answers based on the latest books for the current academic session

What topics are covered in CBSE Class 12 Computer Science Inheritance Extending Classes worksheets?

CBSE Class 12 Computer Science Inheritance Extending Classes worksheets cover all topics as per the latest syllabus for current academic year.

How can I use worksheets to improve my Class 12 Computer Science scores?

Regular practice with Class 12 Computer Science worksheets can help you understand all concepts better, you can identify weak areas, and improve your speed and accuracy.