Wattpad   welcome!  login | sign up   Facebook Connect
 
Read what you like. Share what you write.
2
695 reads
0 comments
9 pages
English
#76135
[PG] Parental Guidance Suggested

important question of computer

Sample Paper - 2008
Class - XII
Subject - Computer Science

basic theory (4 Marks)

1. What do you understand by procedural programming paradigm?
2. What do you understand by object oriented programming paradigm?
3. Explain all the features of OOPs with their implementation in C++.
4. Why main function is so special in C++. Give at least two reasons.
5. Write two advantages of using #include complier directive.
6. Differentiate between a run time error and syntax error. Give one example of each.
7. Illustrate the concept of function overloading with the help of an example.
8. Why is a destructor function required in classes? illustrate with the help of an example.
9. Illustrate the use of this pointer with the help if an example.
10. What is the use of a constructor function in a class ? Give a suitable example for a constructor function in a class.
11. Illustrate the concept of function overloading with the help of an example.
12. Differentiate between a constructor and destructor function.
13. Illustrate the use of "self referencing structures" with the help of an example.
14. What is the purpose of a header file in a program?
15. What do you understand about a base class & a derived class ? if a base class and a derived class each include a member function with the same name and arguments , which member function will be called by the object of the derived class if the scope operator is not used ?
16. What do you understand about a member function ? how does a member function differ from an ordinary function ?
17. Differentiate between call by value & call by reference with a suitable example.
18. Differentiate between global & local variable with a suitable example.
19. Differentiate between nested class & inheritance with a suitable example.
20. Differentiate between default & copy constructor with a suitable example.
21. What are advantages of OOPs over procedural programming?
22. Illustrate the use of #define in C++ to define a macro.
23. Define Multilevel & multiple inheritance in context of OOP with suitable example.
24. Illustrate the use of inline function in C++ with the help of a suitable example.
25. What is a default constructor ? how does it differ from destructor?
26. Differentiate between a date type struct & a data type class in C++.
27. Explain the concept constructor overloading with a suitable example.
28. What do you understand by visibility modes in class derivations ? what are these modes.
29. What do you understand by Syntax Error, logical Error & Run time error.
30. Define the term #define & typedef with suitable example.
Error (2or 3 marks)
1. #include<iostream.h>
void main()
{
const MAX=0;
int a,b;
cin<<a>>b;
if(a>b) MAX=a;
for(x=0,x<MAX;x++) cout<<x;
}
2. #include<iostream.h>
Main()
{
int ch=9,sch=90;
char S[2,2];
if ch<=9
cout<<ch;
for(int x=0;x<2;x++)
for(int y=0;y<2;y++)
{
if(y==0) S[x][y]='A';
else
cout>>S[x][y];
}
getch(); }
3. class X
{
public:
int a,b;
void int(void)
{
a=b=0;
}
int sum(void);
int square(void);
};
int sum(void)
{
return a+b;
}
int square(void)
{
return sum() *sum();
}


4. include<iostream.h>
void main()
{
int R; W=90;
while W>60
{
R=W-50;
switch(W)
{ 20:cout<<"Lower range"<<endl;
30: cout<<"Middle Range"<<endl;
20: cout<<"Higher Range"<<endl;
}
}
}
5. #include<iostream.h>
main()
{
int x[5],*y,z[5];
for(i=0;i<5;i++)
{
x[i]=I;
z[i]=i+3;
y=z; x=y;
}}

6. class ABC
{
int x=10;
float y;
ABC(){ y=5; }
~AB?C() {}
};
void main()
{
ABC a1,a2;
}
7. void main()
{
const int i=20;
const int *const ptr=&i;
(*ptr)++;
int j=15;
ptr =&j;
}
8. #include(iostream.h)
void main()
{
int X[]={60,50,30,40},Y; count=4;
cin>>Y;
for(i=count-1;i>=0;i--)
switch(i)
{
case 0;
case 2: cout<<Y*Y[i]<<endl; break;
case 1:;
cae 3: cout>>Y+X[i];
}
}
9. struct group
{
int x1,x2;
}
void main()
{
g1,g2 group;
cin>>g1.x1<<g2.x2;
g2=g1;
cout<<g2.x2<<g2.x1<<endl;
2+=g1.x1;
cout<<g1.x1<<g1.x2;
}
10. structure swimmingclub
{
int mem number;
char mamname[20]
char memtype[]="LIG";
};
void main()
{
swimmingclub per1,per2;
cin<<"Member Number";
cin>>memnumber.per1;
cout<<"\n Member name";
cin>>per1.membername;
per1.memtype="HIG";
per2=per1;
cin<<"\n Member number "<<per2.memnumber;
cin<<"\n Member name "<<per2.memname;
cin<<"\n Member number "<<per2.memtype;
[PG] Parental Guidance Suggested

Comments & Reviews ^top


Login to post your comment.
Be the first to comment on this!