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)
- What do you mean by static variable? Explain with help of example.
- What is Function Overloading? Give an example in C++ to illustrate the same.
- Differentiate between an identifier and keywords
- Differentiate between object oriented programming and procedural programming
- What do you understand by Copy constructor? Specify two instances when copy constructor is invoked?
- Write header file for function given below.
- Getch ()
- sqrt()
- strcpy()
- exit()
- 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.
- Write the names of header files to which the following belong.
- strcmp( )
- sin( )
- 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.
- 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.
- Define a class Test in C+ + with following description:
Private Members
- TestCode of type integer
- Description of type string
- NoCandidate of type integer
- CenterReqd (number of centers required) of type integer
- A member function CALCNTR( ) to calculate and return the number of centers as (NoCandidate/100+1)
Public Members
- A function SCHEDULE( ) to allow user to enter values for TestCode, Description, NoCandidate & call function CALCNTR( ) to calculate the number of centres.
- A function DISPTEST ( ) to allow user to view the content of all the data members.
- 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
- 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.
Submitted By : Mr. Sandip Kumar Srivastava
Email : [email protected] |
|