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.
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.
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 Study Material
CBSE Class 12 Computer Science Inheritance Extending Classes Worksheet
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. Studiestoday is the best portal for Class 12 students to get all the latest study material free of cost.
Worksheet for Computer Science CBSE Class 12 Inheritance Extending Classes
Expert teachers of studiestoday have referred to the NCERT book for Class 12 Computer Science to develop the Computer Science Class 12 worksheet. If you download the practice worksheet for one chapter daily, you will get higher and better marks in Class 12 exams this year as you will have stronger concepts. Daily questions practice of Computer Science worksheet and its study material will help students to have a stronger understanding of all concepts and also make them experts on all scoring topics. You can easily download and save all revision worksheet for Class 12 Computer Science also from www.studiestoday.com without paying anything in Pdf format. 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
Inheritance Extending Classes worksheet Computer Science CBSE Class 12
All worksheets given above for Class 12 Computer Science have been made as per the latest syllabus and books issued for the current academic year. The students of Class 12 can be rest assured that the answers have been also provided by our teachers for all worksheet of Computer Science so that you are able to solve the questions and then compare your answers with the solutions provided by us. 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. All study material for Class 12 Computer Science students have been given on studiestoday.
Inheritance Extending Classes CBSE Class 12 Computer Science Worksheet
Regular worksheet practice helps to gain more practice in solving questions to obtain a more comprehensive understanding of Inheritance Extending Classes concepts. Worksheets play an important role in developing an understanding of Inheritance Extending Classes in CBSE Class 12. Students can download and save or print all the worksheets, printable assignments, and practice sheets of the above chapter in Class 12 Computer Science in Pdf format from studiestoday. You can print or read them online on your computer or mobile or any other device. After solving these you should also refer to Class 12 Computer Science MCQ Test for the same chapter.
Worksheet for CBSE Computer Science Class 12 Inheritance Extending Classes
CBSE Class 12 Computer Science best textbooks have been used for writing the problems given in the above worksheet. If you have tests coming up then you should revise all concepts relating to Inheritance Extending Classes and then take out a print of the above worksheet and attempt all problems. We have also provided a lot of other Worksheets for Class 12 Computer Science which you can use to further make yourself better in Computer Science
You can download the CBSE Printable worksheets for Class 12 Computer Science Inheritance Extending Classes for latest session from StudiesToday.com
Yes, you can click on the links above and download Printable worksheets in PDFs for Inheritance Extending Classes Class 12 for Computer Science
Yes, the Printable worksheets issued for Class 12 Computer Science Inheritance Extending Classes have been made available here for latest academic session
You can easily access the links above and download the Class 12 Printable worksheets Computer Science Inheritance Extending Classes for each chapter
There is no charge for the Printable worksheets for Class 12 CBSE Computer Science Inheritance Extending Classes you can download everything free
Regular revision of practice worksheets given on studiestoday for Class 12 subject Computer Science Inheritance Extending Classes can help you to score better marks in exams
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
Yes, studiestoday provides worksheets in Pdf for Inheritance Extending Classes Class 12 Computer Science in mobile-friendly format and can be accessed on smartphones and tablets.
Yes, worksheets for Inheritance Extending Classes Class 12 Computer Science are available in multiple languages, including English, Hindi
CBSE Class 12 Computer Science worksheets help students practice all concepts given in their books, improve problem-solving skills, and prepare effectively for CBSE exams
CBSE Class 12 Computer Science Inheritance Extending Classes worksheets cover all topics as per the latest syllabus for current academic year.
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.
All worksheets for Class 12 Computer Science and for Inheritance Extending Classes have solved questions with step by step guide for each solution
Practice atleast one worksheet of Inheritance Extending Classes every day for Class 12 Computer Science