Академический Документы
Профессиональный Документы
Культура Документы
COMPUTER SCIENCE
SCORE: 60
TIME: 2 Hrs
Max. Mark 60
1. Encapsulation is a way to impliment abstraction- Justify? (2)
Encapsulationbn D]-tbm-Kn¨v abstraction impliment sN¿mw
2. a=++a +b++ +c
a=2, b=3, c=1
find a,b,c, after executing the above statement
apI-fn sImSp-¯n-cn-¡p¶ expression excecute sNbvXvI-gn-bp-t¼mÄ a,b,c bpsS hne-sb´v?
3. The function add() can be used for adding two numbers as well as joining two strings. Which
OOP feature can be co-related ? Explain?
add() F¶ function 2 kwJy-IÄ Iq«p¶Xn\v F¶Xn\p-t]mse 2 strings tNÀs¯-gp-Xp-¶-
Xn\pw D]-tbm-Kn-¡p-¶p. OOP sâ GXv feature CXp-ambn _Ô-s¸-«n-cn-¡p¶p? hni-Zo-I-cn-¡pI?
4. Find out the errors and correct the following code
class X
{
int a ;
public :
friend void get ();
{
cin>>a;
}
apI-fn X¶n-cn-¡p¶ program code þ sX-äp-IÄ Ds−-¦n Xncp-¯p-I.
5. Write a program to read and display details empno, empname and date of joining of the
employee
using structure.
structure D]-tbm-Kn-¨v empno, empname and date of joining Ch read sN¿p-¶-Xn\pw
display sN¿p-¶-Xn\pw Bh-iy-amb program Fgp-Xp-I,
6. Consider the following function
int fn(int n)
{
if(int = =1)
return 1;
else
return n+(n-1);
}
Which type of function is this ?
What will be the output if n=4. (2)
GXp coXn-bn-epÅ function BWv apI-fn sImSp-¯n-cn-¡p-¶Xv? n=4. Bbm output F´m-bn-
cn¡pw?
OR
7. Predict the output (2)
enum elts{c=6, N,P,q=17, R,S};
elts e1, c2;
e1-p;
c2=s;
Cout << e1+e2;
apIfn sImSp-¯n-cn-¡p¶ program code sâ output {]h-Nn-¡p-I.
8. int p=1;
for(int i=-5; i<5; i++)
{
p=p*i;
cout <<p}
what will be the output?
apIfn sImSp-¯n-cn-¡p¶ program code sâ output F´mbncn¡pw? (2)
9. while (1)
{
cout<<“x”;
}
How many times the loop will execute?
apIfn sImSp-¯n-cn-¡p¶ program F{X {]mhiyw execute sN¿pw? (1)
10. Complete the following code
# include..................................
void main( )
{
ifstream, ..........................
obj. ...........................(“stud.dat”);
char name [25];
obj>>.........................;
cout<<.......................;
}
apIfn sImSp-¯n-cn-¡p¶ program code ]qÀ¯o-I-cn-¡pI (3)
11. a. “Break the line, Change the sign”, name and state the theorem
apIfn sImSp-¯n-cn-¡p¶ Bibw GXp theorem -hp-ambn _Ô-s¸-«n-cn-¡p-¶p.
b. Drain the logic circuite to add 3 bits. (2)
3 bit add sN¿p¶ logic circuite hc-bv¡pI
OR
12. “DBMS replaces conventional file system.” Justify (5)
apIfn ]dªn-cn-¡p¶ statement justify sN¿p--I.
13. Explain different access method used in data communication ? (3)
Data communication  D]-tbm-Kn-¨n-cn¡p¶
]e Xc-¯n-e¡p access method hni-Zo-I-cn-¡pI
14. Predict the output and give reasons?
class ABC
{
int p,q;
public :
void get (int a, int b)
{
x=a;
y=b;
void display ( )
{
cout<< x<<y;
}
};
void main ( )
{ ABC p1q;
p.get (5,6)
q.display ( );
} (3)
apIfn sImSp¯n-cn-¡p¶ program code sâ output F´m-bn-cn-¡pw ? ImcWw hni-Z-am-
¡p-I.
15. Predict the output and give resons?
class X
{
static int a;
public :
void display ( )
{
cout<<++a;
}
};
int X:: a;
void main ( )
{
X ob1, ob2;
ob1.display( )
ob2.display( )
} (3)
apI-fn sImSp-¯n-cn-¡p¶ program code sâ out put F´m-bn-cn¡pw? ImcWw hni-Zo-I-
cn-¡pI
16. Consider the following prototype
float volum (float x);
float volum (float r, float h);
float volum (float l, float b; flot h)
Which OOP concept is being used here. Explain? (3)
apI-fn sImSp-¯n-cn-¡p¶ GXv OPP concept BWv? hni-Zo-I-cn-¡pI
17. What is the different between
Time T2 (T1)
Time T2 = T1 (2)
c−v statement IÄ X½n-epÅ hyXymkw F´v?
OR
18. class con
{
int x,y;
con ( )
{
x=0;
y=0;
}
};
void main ( )
}
con c;
After completation an error will occer. What is the reason ? (2)
apI-fn sImSp-¯n-cn-¡p¶ code compile sN¿p-t¼mÄ error D−m-Ip-¶p. Imc-W-sa´v
19. Identify the different types of inheritance in the given figure
B C
(3)
20. What is the difference between