SlideShare a Scribd company logo
1. Define : class , object
   2. What is inline function?What points should you take care while making a
       function inline?
    3. What do you understand by Copy constructor? Specify two instances when
       copy constructor is invoked?
   4. Two overloaded functions are defined as:
       void choice (char, char);         -(1)
       void choice (int , float);        -(2)
      Which of functions will be called by following calls.
       choice(‘A’, 10);
       choice (10.5, 10.5);


5) Name the header files to which following standard functions belong:
  i) random()           ii) gotoxy()              iii) getc()           iv) strcmpi()
6) Declare class height containing data members to store height of a person in feet
  and inches.
  Add suitable member functions to:
    Read height of a person
    Display height
    Find and return taller out of two person’s height given as input to functions.
    Convert height in cms.


7) Answer the questions a and b after going through the code :

       class exam
       {
                int mark ;
                char sub [ 30 ];
       public :
                exam ( )                                         Function 1
                {
                        marks = 0 ;
                        strcpy ( sub , “ computer “ );
                }
exam ( char s [ ] )                              Function 2
               {
                       marks = 0 ;
                       strcpy ( sub , s );
               }

               exam ( int m )                                   Function 3
               {
                       marks = m ;
                       strcpy( sub , “ c ++ “ );
               }
               exam ( char s [ ] , int m )                      Function 4
               {
                       marks = m ;
                       strcpy ( sub , s );
               }
      }

      a.       Write statements to execute all four functions                            (1)

      b.       Can we over load a destructor .                                           (1/2)
      c.       What concept of OOPS is demonstrated by the four functions                (1/2)


8) Define a class ELECTION with the following specifications . Write a suitable main ( ) function
     also to declare 3 objects of ELECTION type and find the winner and display the details .
                                                                                         (3)

      Private members :
      Data :          candidate_name , party , vote_received
      Public members :
      Functions       :       enterdetails ( ) – to input data
                              Display ( ) – to display the details of the winner
                              Winner ( ) – To return the details of the winner trough the object
      after comparing the votes received by three candidates .

  9) Give any two characteristics of constructors and destructors.
  10) Explain default constructor ans constructor with default values.

More Related Content

PPTX
Object Oriented Programming - Constructors & Destructors
PPT
C++: Constructor, Copy Constructor and Assignment operator
PPTX
Constructors
PDF
CBSE Question Paper Computer Science with C++ 2011
PPTX
Constructor in c++
PPTX
Concept of constructors
PPTX
Constructor&method
PDF
Dotnet unit 4
Object Oriented Programming - Constructors & Destructors
C++: Constructor, Copy Constructor and Assignment operator
Constructors
CBSE Question Paper Computer Science with C++ 2011
Constructor in c++
Concept of constructors
Constructor&method
Dotnet unit 4

What's hot (16)

PPTX
Java Foundations: Data Types and Type Conversion
DOCX
Data Structure Project File
PPT
Oop lecture5
PPT
Bca 2nd sem u-2 classes & objects
PPT
Polymorphism
PPTX
Syntax Comparison of Golang with C and Java - Mindbowser
PDF
Class xi sample paper (Computer Science)
DOCX
Bc0037
PPT
Constructor and destructor in C++
PDF
Intake 38 6
ZIP
147301 nol
PPTX
Fsharp shdh 40 lightning talk
PPT
C++: inheritance, composition, polymorphism
PPT
Python Part 1
PPTX
Virtual base class
Java Foundations: Data Types and Type Conversion
Data Structure Project File
Oop lecture5
Bca 2nd sem u-2 classes & objects
Polymorphism
Syntax Comparison of Golang with C and Java - Mindbowser
Class xi sample paper (Computer Science)
Bc0037
Constructor and destructor in C++
Intake 38 6
147301 nol
Fsharp shdh 40 lightning talk
C++: inheritance, composition, polymorphism
Python Part 1
Virtual base class
Ad

Viewers also liked (14)

PDF
Us doc 8
PPTX
Poverty an alarming threat
XLS
Mba2 ac
PPT
Selling Skills
PDF
Outsourcery Disaggregation Point of View
PPTX
Parliament Explained | European scrutiny | House of Commons | 29 October 2015
DOCX
Education plan
PDF
Marketing Strategy: Evolution Of A Species
PPTX
Экспресс аудит сайтов
PPT
Ideas About Chinese Education
PPT
Group Housing Bye Laws
PPT
Wib director a day in the life
PPTX
Ishaan ppt
DOCX
CHRISTINA HUNT 2.0
Us doc 8
Poverty an alarming threat
Mba2 ac
Selling Skills
Outsourcery Disaggregation Point of View
Parliament Explained | European scrutiny | House of Commons | 29 October 2015
Education plan
Marketing Strategy: Evolution Of A Species
Экспресс аудит сайтов
Ideas About Chinese Education
Group Housing Bye Laws
Wib director a day in the life
Ishaan ppt
CHRISTINA HUNT 2.0
Ad

Similar to Xii Compsc Hw (20)

PDF
computer science sample papers 2
DOC
Sp 1418794917
RTF
CBSE Grade12, Computer Science, Sample Question Paper
PPT
Review constdestr
PDF
Cbse question paper class_xii_paper_2000
PPT
Mca 2nd sem u-2 classes & objects
PDF
Ds lab handouts
PDF
Computer Science Sample Paper 2
 
PDF
CS Sample Paper 1
 
PDF
Sample Questions for XII Computer Science (2).pdf
PPT
Lecture5
PDF
Cbse question-paper-computer-science-2009
PDF
Computer science sqp
PPTX
05 Object Oriented Concept Presentation.pptx
PDF
Computer Science Sample Paper 2015
PDF
22 scheme OOPs with C++ BCS306B_module2.pdfmodule2.pdf
PDF
Computer science-2010-cbse-question-paper
PPTX
Chp8_C++_Functions_Part2_User-defined functions.pptx
PPTX
Arrays, Structures And Enums
PDF
The Ring programming language version 1.5.3 book - Part 31 of 184
computer science sample papers 2
Sp 1418794917
CBSE Grade12, Computer Science, Sample Question Paper
Review constdestr
Cbse question paper class_xii_paper_2000
Mca 2nd sem u-2 classes & objects
Ds lab handouts
Computer Science Sample Paper 2
 
CS Sample Paper 1
 
Sample Questions for XII Computer Science (2).pdf
Lecture5
Cbse question-paper-computer-science-2009
Computer science sqp
05 Object Oriented Concept Presentation.pptx
Computer Science Sample Paper 2015
22 scheme OOPs with C++ BCS306B_module2.pdfmodule2.pdf
Computer science-2010-cbse-question-paper
Chp8_C++_Functions_Part2_User-defined functions.pptx
Arrays, Structures And Enums
The Ring programming language version 1.5.3 book - Part 31 of 184

More from dee_malhotra73 (20)

PDF
Special Edition : Facing Lockdown
PDF
Newsletter for the month of February -2020
PDF
Newsletter for month of January 2020
PDF
Newsletter for December 2019
PDF
Newsletter November 2019
PDF
Newsletter for October 2019
PDF
Newsletter for September 2019
PDF
Newsletter for month of August 2019
PDF
Newsletter for Month of July 2019
PDF
Newsletter for the Month of January to March2019
PDF
Newsletter For the Month of July to September 2018
PDF
Newsletter for the month October to December 2018
PDF
Newsletter for Month : January - March 2018
PDF
Newsletter for the month of October to December 2017
PDF
Newsletter for the month of October to December 2017
PDF
Final July to September - 2017
PDF
Newsletter for the month of April-June 2017
PDF
Newsletter - January to March 2017
PDF
Newsletter for October - December 2016
PDF
NewsLetter for April - June 2016
Special Edition : Facing Lockdown
Newsletter for the month of February -2020
Newsletter for month of January 2020
Newsletter for December 2019
Newsletter November 2019
Newsletter for October 2019
Newsletter for September 2019
Newsletter for month of August 2019
Newsletter for Month of July 2019
Newsletter for the Month of January to March2019
Newsletter For the Month of July to September 2018
Newsletter for the month October to December 2018
Newsletter for Month : January - March 2018
Newsletter for the month of October to December 2017
Newsletter for the month of October to December 2017
Final July to September - 2017
Newsletter for the month of April-June 2017
Newsletter - January to March 2017
Newsletter for October - December 2016
NewsLetter for April - June 2016

Xii Compsc Hw

  • 1. 1. Define : class , object 2. What is inline function?What points should you take care while making a function inline? 3. What do you understand by Copy constructor? Specify two instances when copy constructor is invoked? 4. Two overloaded functions are defined as: void choice (char, char); -(1) void choice (int , float); -(2) Which of functions will be called by following calls. choice(‘A’, 10); choice (10.5, 10.5); 5) Name the header files to which following standard functions belong: i) random() ii) gotoxy() iii) getc() iv) strcmpi() 6) Declare class height containing data members to store height of a person in feet and inches. Add suitable member functions to:  Read height of a person  Display height  Find and return taller out of two person’s height given as input to functions.  Convert height in cms. 7) Answer the questions a and b after going through the code : class exam { int mark ; char sub [ 30 ]; public : exam ( ) Function 1 { marks = 0 ; strcpy ( sub , “ computer “ ); }
  • 2. exam ( char s [ ] ) Function 2 { marks = 0 ; strcpy ( sub , s ); } exam ( int m ) Function 3 { marks = m ; strcpy( sub , “ c ++ “ ); } exam ( char s [ ] , int m ) Function 4 { marks = m ; strcpy ( sub , s ); } } a. Write statements to execute all four functions (1) b. Can we over load a destructor . (1/2) c. What concept of OOPS is demonstrated by the four functions (1/2) 8) Define a class ELECTION with the following specifications . Write a suitable main ( ) function also to declare 3 objects of ELECTION type and find the winner and display the details . (3) Private members : Data : candidate_name , party , vote_received Public members : Functions : enterdetails ( ) – to input data Display ( ) – to display the details of the winner Winner ( ) – To return the details of the winner trough the object after comparing the votes received by three candidates . 9) Give any two characteristics of constructors and destructors. 10) Explain default constructor ans constructor with default values.