Friday 29th March 2024
REGISTRATION
Online Fashion Store

CBSE Important Questions

CBSE Guess > Papers > Important Questions > Class XII > 2013 > Computer Science > Computer Science - by Mr. Sandip Kumar Srivastava

CBSE CLASS XII

Computer Science (C++ and Data Structure)

Index Next

 

  1. What do you mean by static variable? Explain with help of example.
  2. What is Function Overloading? Give an example in C++ to illustrate the same.
  3. Differentiate between an identifier and keywords
  4. Differentiate between object oriented programming and procedural programming
  5. What do you understand by Copy constructor? Specify two instances when copy constructor is invoked?
  6. Write header file for function given below.
    1. Getch ()
    2. sqrt()
    3. strcpy()
    4. exit()
  7. When a function is overloaded, there are multiple definitions of the functions. What makes the various definitions of the function different from each other? Support your answer with suitable example.
  8. Write the names of header files to which the following belong.
    1. strcmp( )
    2. sin( )
  9. When the object is passed to the function, the copy of the object is made. Does constructor and destructor is called for the object copy? Also explain the meaning of the two.
  10. Answer the question (i) and (ii) after going through the following class
    class Exam
    {
    int year;
    public:
    Exam(int y ) // Constructor 1
    { year=y);}
    Exam(Exam &t) //  Constructor 2
    };
    i) Create an object, such that it invokes Constructor 1.
    ii)  Write complete definition for Constructor 2.
  11. Define a class Test in C+ + with following description:
    Private Members
    1. TestCode of type integer
    2. Description of type string
    3. NoCandidate of type integer
    4. CenterReqd (number of centers required) of type integer
    5. A member function CALCNTR( ) to calculate and return the number of centers as (NoCandidate/100+1)
    Public Members
    1. A function SCHEDULE( ) to allow user to enter values for TestCode, Description, NoCandidate & call function CALCNTR( ) to calculate the number of centres.
    2. A function DISPTEST ( ) to allow user to view the content of all the data members.
  12. Assume that a text file named TEXT1.TXT already contains some text written into it, write a function named vowelwords( ), that reads the file TEXT1.TXT and create a new file named TEXT2.TXT, which shall contain only those words from the file TEXT1.TXT which don’t start with an uppercase vowel(i.e ‘A’,’E’,’I’,’O’,’U’).
    For example if the file TEXT1.TXT contains
    Carry Umbrella and Overcoat When it Rains
    then the file TEXT2.TXT shall contains
    Carry When it Rains
  13. Given a binary file APPLY.DAT, containing records of the following class Applicant type
    class Applicant
    {
    char A_Rno[10];
    char A_Name[30];
    int A_Score;
    public:
    void Enrol( )
    {
    gets(A_Rno);
    gets(A_Name);
    cin>>A_Score;
    }
    void Status( )
    {
    cout<<setw(20)<<A_Rno;
    cout<<setw(20)<<A_Name;
    cout<<setw(10)<<A_Score<<endl;
    }
    int ReturnScore( )
    { return A_Score;}
    };
    Write a function in C++, that would read contents of file APPLY.DAT and display Students whose A_Score is below 70.

 

Index Next

Submitted By : Mr. Sandip Kumar Srivastava
Email : [email protected]