SlideShare una empresa de Scribd logo
1 de 2
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.

Más contenido relacionado

La actualidad más candente

Class xi sample paper (Computer Science)
Class xi sample paper (Computer Science)Class xi sample paper (Computer Science)
Class xi sample paper (Computer Science)
MountAbuRohini
 
C++: inheritance, composition, polymorphism
C++: inheritance, composition, polymorphismC++: inheritance, composition, polymorphism
C++: inheritance, composition, polymorphism
Jussi Pohjolainen
 
Virtual base class
Virtual base classVirtual base class
Virtual base class
Tech_MX
 

La actualidad más candente (16)

Java Foundations: Data Types and Type Conversion
Java Foundations: Data Types and Type ConversionJava Foundations: Data Types and Type Conversion
Java Foundations: Data Types and Type Conversion
 
C Structure and Union in C
C Structure and Union in CC Structure and Union in C
C Structure and Union in C
 
Data Structure Project File
Data Structure Project FileData Structure Project File
Data Structure Project File
 
Oop lecture5
Oop lecture5Oop lecture5
Oop lecture5
 
Bca 2nd sem u-2 classes & objects
Bca 2nd sem u-2 classes & objectsBca 2nd sem u-2 classes & objects
Bca 2nd sem u-2 classes & objects
 
Polymorphism
PolymorphismPolymorphism
Polymorphism
 
Syntax Comparison of Golang with C and Java - Mindbowser
Syntax Comparison of Golang with C and Java - MindbowserSyntax Comparison of Golang with C and Java - Mindbowser
Syntax Comparison of Golang with C and Java - Mindbowser
 
Class xi sample paper (Computer Science)
Class xi sample paper (Computer Science)Class xi sample paper (Computer Science)
Class xi sample paper (Computer Science)
 
Bc0037
Bc0037Bc0037
Bc0037
 
Constructor and destructor in C++
Constructor and destructor in C++Constructor and destructor in C++
Constructor and destructor in C++
 
Intake 38 6
Intake 38 6Intake 38 6
Intake 38 6
 
147301 nol
147301 nol147301 nol
147301 nol
 
Fsharp shdh 40 lightning talk
Fsharp shdh 40 lightning talkFsharp shdh 40 lightning talk
Fsharp shdh 40 lightning talk
 
C++: inheritance, composition, polymorphism
C++: inheritance, composition, polymorphismC++: inheritance, composition, polymorphism
C++: inheritance, composition, polymorphism
 
Python Part 1
Python Part 1Python Part 1
Python Part 1
 
Virtual base class
Virtual base classVirtual base class
Virtual base class
 

Destacado

Poverty an alarming threat
Poverty an alarming threat Poverty an alarming threat
Poverty an alarming threat
pravar24
 
Outsourcery Disaggregation Point of View
Outsourcery Disaggregation Point of ViewOutsourcery Disaggregation Point of View
Outsourcery Disaggregation Point of View
Damon Crawford
 
Wib director a day in the life
Wib director a day in the lifeWib director a day in the life
Wib director a day in the life
Colleen LaRose
 

Destacado (14)

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

Similar a Xii Compsc Hw

Review constdestr
Review constdestrReview constdestr
Review constdestr
rajudasraju
 
Cbse question paper class_xii_paper_2000
Cbse question paper class_xii_paper_2000Cbse question paper class_xii_paper_2000
Cbse question paper class_xii_paper_2000
Deepak Singh
 
Cbse question-paper-computer-science-2009
Cbse question-paper-computer-science-2009Cbse question-paper-computer-science-2009
Cbse question-paper-computer-science-2009
Deepak Singh
 
Computer science-2010-cbse-question-paper
Computer science-2010-cbse-question-paperComputer science-2010-cbse-question-paper
Computer science-2010-cbse-question-paper
Deepak Singh
 

Similar a Xii Compsc Hw (20)

computer science sample papers 2
computer science sample papers 2computer science sample papers 2
computer science sample papers 2
 
Sp 1418794917
Sp 1418794917Sp 1418794917
Sp 1418794917
 
CBSE Grade12, Computer Science, Sample Question Paper
CBSE Grade12, Computer Science, Sample Question PaperCBSE Grade12, Computer Science, Sample Question Paper
CBSE Grade12, Computer Science, Sample Question Paper
 
Review constdestr
Review constdestrReview constdestr
Review constdestr
 
Cbse question paper class_xii_paper_2000
Cbse question paper class_xii_paper_2000Cbse question paper class_xii_paper_2000
Cbse question paper class_xii_paper_2000
 
Mca 2nd sem u-2 classes & objects
Mca 2nd  sem u-2 classes & objectsMca 2nd  sem u-2 classes & objects
Mca 2nd sem u-2 classes & objects
 
Ds lab handouts
Ds lab handoutsDs lab handouts
Ds lab handouts
 
Computer Science Sample Paper 2
Computer Science Sample Paper 2Computer Science Sample Paper 2
Computer Science Sample Paper 2
 
CS Sample Paper 1
CS Sample Paper 1CS Sample Paper 1
CS Sample Paper 1
 
Lecture5
Lecture5Lecture5
Lecture5
 
Cbse question-paper-computer-science-2009
Cbse question-paper-computer-science-2009Cbse question-paper-computer-science-2009
Cbse question-paper-computer-science-2009
 
Computer science sqp
Computer science sqpComputer science sqp
Computer science sqp
 
Computer Science Sample Paper 2015
Computer Science Sample Paper 2015Computer Science Sample Paper 2015
Computer Science Sample Paper 2015
 
Computer science-2010-cbse-question-paper
Computer science-2010-cbse-question-paperComputer science-2010-cbse-question-paper
Computer science-2010-cbse-question-paper
 
Arrays, Structures And Enums
Arrays, Structures And EnumsArrays, Structures And Enums
Arrays, Structures And Enums
 
The Ring programming language version 1.5.3 book - Part 31 of 184
The Ring programming language version 1.5.3 book - Part 31 of 184The Ring programming language version 1.5.3 book - Part 31 of 184
The Ring programming language version 1.5.3 book - Part 31 of 184
 
OBJECT ORIENTED PROGRAMING IN C++
OBJECT ORIENTED PROGRAMING IN C++ OBJECT ORIENTED PROGRAMING IN C++
OBJECT ORIENTED PROGRAMING IN C++
 
History of C#
History of C#History of C#
History of C#
 
Java unit2
Java unit2Java unit2
Java unit2
 
Computer science ms
Computer science msComputer science ms
Computer science ms
 

Más de dee_malhotra73

Más de dee_malhotra73 (20)

Special Edition : Facing Lockdown
Special Edition :  Facing LockdownSpecial Edition :  Facing Lockdown
Special Edition : Facing Lockdown
 
Newsletter for the month of February -2020
Newsletter for the month of  February -2020Newsletter for the month of  February -2020
Newsletter for the month of February -2020
 
Newsletter for month of January 2020
Newsletter for month of  January  2020Newsletter for month of  January  2020
Newsletter for month of January 2020
 
Newsletter for December 2019
Newsletter for December 2019Newsletter for December 2019
Newsletter for December 2019
 
Newsletter November 2019
Newsletter November 2019Newsletter November 2019
Newsletter November 2019
 
Newsletter for October 2019
Newsletter  for October 2019Newsletter  for October 2019
Newsletter for October 2019
 
Newsletter for September 2019
Newsletter for  September 2019Newsletter for  September 2019
Newsletter for September 2019
 
Newsletter for month of August 2019
Newsletter for month of August 2019Newsletter for month of August 2019
Newsletter for month of August 2019
 
Newsletter for Month of July 2019
Newsletter for Month of  July 2019Newsletter for Month of  July 2019
Newsletter for Month of July 2019
 
Newsletter for the Month of January to March2019
Newsletter for the Month of January to March2019Newsletter for the Month of January to March2019
Newsletter for the Month of January to March2019
 
Newsletter For the Month of July to September 2018
Newsletter For the Month of July to September 2018Newsletter For the Month of July to September 2018
Newsletter For the Month of July to September 2018
 
Newsletter for the month October to December 2018
Newsletter for the month October to December 2018Newsletter for the month October to December 2018
Newsletter for the month October to December 2018
 
Newsletter for Month : January - March 2018
Newsletter  for Month : January -  March 2018Newsletter  for Month : January -  March 2018
Newsletter for Month : January - March 2018
 
Newsletter for the month of October to December 2017
Newsletter  for the month of October to December 2017Newsletter  for the month of October to December 2017
Newsletter for the month of October to December 2017
 
Newsletter for the month of October to December 2017
Newsletter  for the month of October to December 2017Newsletter  for the month of October to December 2017
Newsletter for the month of October to December 2017
 
Final July to September - 2017
Final July to September - 2017Final July to September - 2017
Final July to September - 2017
 
Newsletter for the month of April-June 2017
Newsletter  for the month of April-June 2017Newsletter  for the month of April-June 2017
Newsletter for the month of April-June 2017
 
Newsletter - January to March 2017
Newsletter - January to March 2017Newsletter - January to March 2017
Newsletter - January to March 2017
 
Newsletter for October - December 2016
Newsletter for October - December 2016Newsletter for October - December 2016
Newsletter for October - December 2016
 
NewsLetter for April - June 2016
NewsLetter for April - June 2016NewsLetter for April - June 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.