Questions – Exam Papers – Computer Sir Ki Class

Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  


Shop
siteicon
Question Typewise Collection-"Fill In The Blanks" Questions - Exam Papers (CPP) No. of Q.5
Q.1   Exam - CBSE12D-2017/02B/2

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

class EXAM
{
  long Code;
  char EName[20];
  float Marks;
public:
  EXAM()           //Member Function 1
  {
    Code=100;strcpy(EName,"Noname");Marks=0;
  }
  EXAM(EXAM &E)    //Member Function 2
{
  Code=E.Code+1;
  strcpy(EName,E.EName);
  Marks=E.Marks;
}
};
void main()
{
  ___________________     //Statement 1
  ___________________     //Statement 2
}

(i) Which Object Oriented Programming feature is illustrated by the Member Function 1 and Member Function 2 together in the class EXAM?

(ii) Write Statement 1 and Statement 2 to execute Member Function 1 and Member Function 2 respectively.



Q.2   Exam - CBSE12A-2015/02B/2

Observe the following C++ code and answer the questions (i) and (ii) :

class Passenger
{
  long PNR;
  char Name [20] ;
public:
  Passenger()                 //Function 1
  { cout<<"Ready"<<endl; }
  
  void Book(long P,char N[])  //Function 2
  { PNR = P; strcpy(Name, N); }
  
  void Print()                //Function 3
  { cout«PNR << Name <<endl; }
  
  ~Passenger()                //Function 4
  { cout<<"Booking cancelled!"<<endl; }
};

(i) Fill in the blank statements in Line 1 and Line 2 to execute Function 2 and Function 3 respectively in the following code:

void main()
{
  Passenger P;
  ___________ //Line 1
  ___________ //Line 2
}//Ends here

(ii) Which function will be executed at } //Ends here? What is this function referred as ?



Q.3   Exam - CBSE12D-2015/02B/2

Observe the following C++ code and answer the questions (i) and (ii) :

class Traveller
{
  long PNR;
  char TName[20];
public :
  Traveller()                  //Function 1
  {cout<<"Ready"<<endl;}
  void Book(long P,char N[])   //Function 2
  {PNR = P; strcpy(TName, N);}
  void Print()                 //Function 3
  {cout<<PNR << TName <<endl;}
  ~Traveller()                 //Function 4
  {cout<<"Booking cancelled!"<<endl;}
};

(i) Fill in the blank statements in Line 1 and Line 2 to execute Function 2 and Function 3 respectively in the following code:

v oid main{)
{
  Traveller T;
  _____________ //Line 1
  _____________ //Line 2
}//Stops here

(ii) Which function will be executed at }//Stops here? What is this
function referred as ?



Q.4   Exam - CBSE12A-2017/02B/2

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

class TEST
{
  long TCode;
  char TTitle[20];
  float Score;
public:
  TEST()    //Member Function 1
  {
    TCode=100;strcpy(TTitle,”FIRST Test”);Score=0;
  }
  TEST(TEST &T)    //Member Function 2
  {
    TCode=E.TCode+1;
    strcpy(TTitle,T.TTitle);
    Score=T.Score;
   }
};
void main()
{
___________________     //Statement 1
___________________     //Statement 2
}

(i) Which Object Oriented Programming feature is illustrated by the Member Function 1 and Member Function 2 together in the class TEST?

(ii) Write Statement 1 and Statement 2 to execute Member Function 1 and Member Function 2 respectively.



Q.5   Exam - CBSE12A-2018/02B/2

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

class FIRST
{
  int Num1;
  public:
  void Display() //Member Function 1
  {
    cout<<Num1<<endl;
  }
};
class SECOND: public FIRST
{
  int Num2;
  public:
  void Display() //Member Function 2
  {
    cout<<Num2<<endl;
  }
};
void main()
{
  SECOND S;
  ___________________ //Statement 1
  ___________________ //Statement 2
}

(i) Which Object Oriented Programming feature is illustrated by the definitions of
classes FIRST and SECOND?

(ii) Write Statement 1 and Statement 2 to execute Member Function 1 and Member
Function 2 respectively using the object S.