Find Your Free Essay Examples

Important Questions Class 12 Computer Science C Constructor Destructor

Free PDF download of Important Questions for CBSE Class 12 Computer Science (C++) Chapter 4 Constructor and Destructor prepared by expert Computer Science (C++) teachers from latest edition of CBSE(NCERT) books, On StudySolver.Org to score more marks in CBSE board examination.

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

Question 2: Find and write the output of the following C++ program code:  Delhi 2016 NOTE Assume all required header files are already being included in the program.

Аnswer: Output of the given program would be: Date : 1 1024#150 Date : 29 2015#400 Date : 20 1001#180 Question 3: Observe the following C++ code and answer the questions (i) and (ii). Assume all necessary files are included:

Question 4: Find and write the output of the following C++ program code: All India 2016 NOTE Assume all required header files are already being included in the program.

Аnswer: Output of the given program would be: Date: 28 1324#400 Date: 1 1435#250 Date: 26 1000#75 Question 5: Observe the following C++ code and answer the questions (i) and (ii).  All India 2016 NOTE Assume all necessary files are included :

Question 6: Differentiate between Constructor and Destructor functions giving suitable example using a class in C++. When does each of them execute?  Delhi 2016 or Write any two differences between constructor and destructor. Write the function header for constructor and destructor of a class Member.  Delhi 2013 or Differentiate between constructor and destructor functions in a class. Give a suitable example in C+ + to illustrate the difference.  Delhi 2012c or Differentiate between constructor and destructor function with respect to object oriented programming.  All India 2011 Аnswer: Differences between constructor and destructor :

Question 7: What is copy constructor? Give an example in C++ to illustrate copy constructor.  All Indio 2016C, Delhi 2009 or What is a copy constructor? Give a suitable example in C++ to illustrate with its definition within a class and a declaration of an object with the help of it.  Delhi 2015, All Indio 2015 Аnswer: Copy Constructor A copy constructor is that constructor which is used to initialise one object with the values from another object of same class during declaration. e.g.

Question 8: Write the output of the following C++ program code: Delhi 2015 NOTE Assume all required header files are already being included in the program.

Аnswer: Output of the given program would be: C#0 J#1 H#1 Question 9: Observe the following C++ code and answer the questions (i) and (ii):

Question 10: Write the output of the following C++ program code:  All India 2015 NOTE Assume all the required header files are already being included in the program.

Аnswer: Output of the given program would be: B#0 I#1 G#1 Question 11: Observe the following C++ code and answer the questions (i) and (ii) :  All India 2015

Question 12: Write the output of the following C++ program code:  All India 2015c NOTE: Assume all required header files are already being included in the program.

Аnswer: Output of the given program would be: 100 : None : 100 102 : Penci1 : 50 101 : Pen : 105 Question 13: Observe the following C++ code and answer the questions (i) and (ii):  All India 201SC

Question 14: Answer the question (i) and (ii) after going through the following class:  All India 2014C

Question 15: Write four characteristics of a constructor function used in a class.  Delhi 2014 Аnswer: Characteristics of the constructor function used in a class are as follows:

Question 16: Answer the questions (i) and (ii) after going through the following class:  Delhi 2014

Question 17: Obtain the output of the following C++ program, which will appear on the screen after its execution. Delhi 2014 Important Note All the desired header files are already included in the code, which are required to run the code.

Аnswer: Output of the given program would be: [email protected] [email protected] 75 [email protected] 120 Question 18: Obtain the output of the following C++ after its execution.  All India 2014 Important Note All the desired header files are already included in the code, which are required to run the code.

Аnswer: Output of the given program would be: [email protected] [email protected] 11 [email protected] 25 Question 19: Answer the questions (i) and (ii) after going through the following class:

Question 20: Write any two similarities between constructors and destructors. Write the function headers for constructor and destructor of a class Flight.  All India 2013 Аnswer: Similarities between constructor and destructor

Question 21: Answer the questions (i) and (ii) after going through the following class:  All India 2013

Question 22: Write the output of the following program:  Delhi 2013c

Аnswer: Output of the given program would be: 1#0 1#10 2#25 Question 23: Observe the following C++ code carefully and obtain the output, which will appear on the screen after execution of it. All India 2013

Аnswer: Output of the given program would be: 1:15&63% 2 :12&73% 1:15&78% Question 24: Observe the following C++ code carefully and obtain the output, which will appear on the screen after execution of it. Delhi 2013

Аnswer: Output of the given program would be: 2:30&60% 5; 228.75% 2:30&65% Question 25: Answer the questions (i) and (ii) after going through the following class:  Delhi 2013 C

Question 26: Answer the questions (i) and (ii) after going through the following class:  Delhi 2013

Question 27: Answer the questions (i) and (ii) after going through the following class:  Delhi 2012

Question 28: Answer the questions (i) and (ii) after going through the following class:  All India 2012

Question 29: Find the output of the following program:  Delhi 2012

Аnswer: Output of the given program would be: 10:0:0 1:3:210 10:0:0 Question 30: Find the output of the following program:  All India 2012

Аnswer: Output of the given program would be: 5:1:20 1:1:50 5:2:50 Question 31: Rewrite the following program after removing the syntactical errors (if any). Underline each correction.  Delhi 2011c

Question 32: Answer the questions (i) and (ii) after going through the following class;  All India 2010

Question 33: Answer the questions (i) and (ii) after going through the following class:  Delhi 2016

Question 34: Answer the questions (i) and (ii) after going through the following class:  HOTS; Delhi 2009

Question 35: Answer the questions (i) and (ii) after going through the following class:  Delhi 2009C

Question 36: Answer the questions (i) and (ii) after going through the following class:  All India 2009

Question 37: Rewrite the following C++ program code after removing the syntax error(s) (if any). Underline each correction.  Delhi 2009

Question 38: Rewrite the following program after removing the syntactical error(s) (if any). Underline each correction.  All India 2009

4 Marks Questions Question 39: Define a class CABS in C++ with the following specification:  Delhi 2014 Data members

Question 40: Define a class Tourist in C++ with the following specification:  All India 2014 Data members

Question 41: Define a class CONTEST in C + + with the following description:  All India 2014C Private Data Members Eventno – integer Description – char (30) Score – integer qualified –  char Public Member functions

Question 42: Define a class Bus in C++ with the following specifications: HOTS;  All India 2013 Data members

Question 43: Define a class Tourist in C++ with the following specification:  Delhi 2013 Data members

Your email address will not be published. Required fields are marked *

Save my name, email, and website in this browser for the next time I comment.

Its name is same as the class name.

Its name is same as the class name preceded by the tilde (-) sign.

It is automatically called whenever an object is created.

It is automatically called whenever an object goes out of the scope.