Page 1
2022 XI 18 0230 Seat No.
Time : 1½ Hours FIRST-TERM COMPUTER SCIENCE
Subject Code
H 4 7 0 5
Total No. of Questions : 40 (Printed Pages : 24) Maximum Marks : 40
INSTRUCTIONS : (i) Every question has four choices (A), (B), (C) and (D)
and only one of them is the correct answer.
(ii) On the OMR sheet, darken completely with a ball point
pen ONLY ONE bubble you consider as the most
appropriate answer.
(iii) Multiple markings are invalid.
(iv) Use Blue or Black ball point pen only.
(v) Do not fold the OMR sheet or use white ink.
(vi) For each question, you will be awarded ONE mark,
if you have darkened only the bubble corresponding to
the correct answer. In all other cases, you will get zero
mark. There is no negative mark.
(vii) Once the bubble is filled it is not possible to change
the answer.
(viii) Only one OMR sheet will be provided.
Hence sufficient care must be taken while darkening
the bubble.
H-4705 [FT] 1 P.T.O.
Page 2
1. A ............... is a device that connects one Local Area Network (LAN) to another
Local Area Network (LAN) that uses the same protocol.
(A) Repeater
(B) Gateway
(C) Bridge
(D) Switch
2. URL stands for .......................... .
(A) Uniform Resource Locator
(B) Universal Resource Locator
(C) Uniform Retention Locator
(D) Universal Retention Locator
3. Buying and selling goods over the internet is called .................. .
(A) Hyper-Marketing
(B) Cyber Billing
(C) Cyber Selling
(D) E-Commerce
4. The expression for Absorption Law is given by ................... .
(A) A + AB = B
(B) A + AB = A
(C) A + B = B + A
(D) AB = BA
H-4705 [FT] 2
Page 3
5. The logic function of an EX-NOR gate having A and B as its input is ........
(A) A’B + A’B’ (B) A’B’ + AB’
(C) A’B + AB’ (D) A’B’ + AB
6. The process of wrapping up of the data and functions into a single unit is
called as .......................... .
(A) Abstraction (B) Encapsulation
(C) Inheritance (D) Polymorphism
7. To eliminate the cost of calls to small functions, C++ proposes a new feature
called ..................... .
(A) Inline Function (B) In built function
(C) Micro Function (D) Member Function
8. A class that is used for derivation of other classes only is known as ............
class.
(A) Abstract (B) Base
(C) Derived (D) Virtual
9. The programming feature which provides the ability to take multiple forms
is known as ...................... .
(A) Abstraction (B) Encapsulation
(C) Polymorphism (D) Inheritance
H-4705 [FT] 3 P.T.O.
Page 4
10. Identify the correct statement regarding scope of variables :
(A) Global variables are declared in a separate file and accessible from any
program
(B) Local variables are declared inside a function and accessible within
the function only
(C) Global variables are declared inside a function and accessible from
anywhere in program
(D) Local variables are declared in the main function and accessible to
other functions
11. Arrange the following types of network according to their size, from largest
to smallest :
(A) WAN, LAN, MAN (B) MAN, LAN, WAN
(C) LAN, WAN, MAN (D) WAN, MAN, LAN
12. The figure shown below is a block diagram of ..................... topology.
(A) Ring (B) Star
(C) Bus (D) Tree
H-4705 [FT] 4
Page 5
13. Determine the values of A, B, C and D that make the minterm A’BC’D.
(A) A = 0, B = 1, C = 0, D = 1
(B) A = 0, B = 0, C = 0, D = 1
(C) A = 1, B = 1, C = 1, D = 1
(D) A = 0, B = 0, C = 1, D = 1
14. From the truth table below, determine the standard SOP expression :
Inputs Output
A B C X
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 0
(A) X = A’B’C’ + ABC + AB’C
(B) X = A’B’C + A’BC + ABC’
(C) X = AB’C + A’BC + ABC’
(D) X = A’B’C + A’B’C’ + AB’C’
H-4705 [FT] 5 P.T.O.
Page 6
15. Which of the following logic expressions represents the logic diagram shown ?
(A) X = AB’ + A’B
(B) X = (AB)’ + AB
(C) X = (AB)’ + A’B’
(D) X = A’B’ + AB
16. One of the De Morgan’s theorems states that (X + Y)’ = X’Y’. This means
that logically there is no difference between :
(A) A NOR and an AND gate with inverted inputs
(B) A NAND and an OR gate with inverted inputs
(C) An AND and a NOR gate with inverted inputs
(D) A NOR and a NAND gate with inverted inputs
17. Identify the dual of the Boolean expression A + A’B + B’.
(A) A’ + (A + B’) + B
(B) A’.(A + B’).B
(C) A.(A’ + B).B’
(D) A.(A’B).B’
H-4705 [FT] 6
Page 7
18. Which of the following is a valid destructor of the class name ‘‘Country’’ ?
(A) int ~Country() (B) void Country()
(C) int ~Country(Country obj) (D) ~Country()
19. If a class X needs to be derived from a class Y, which of the following ways
is correct to do so ?
(A) class Y : public X (B) class X : public Y
(C) class X :: public Y (D) class Y :: public X
20. Consider the following program segment and determine the missing loop/
loops that will generate the following pattern :
4444
333
22
1
for(int i=4;i>=1;i--)
{
//missing loop
cout<<i;
cout<<endl; }
(I) for(int j=i;j<=1;j++)
(II) for(int j=i;j>=1;j--)
(III) for(int j=3;j>=1;j--)
(IV) for(int j=i;j<=3;j++)
(V) for(int j=1;j<=i;j++)
(A) (II) only (B) (II) and (V) only
(C) (V) only (D) (III), (IV) and (V)
H-4705 [FT] 7 P.T.O.
Page 8
21. What will be the output of the following code ?
#include <iostream.h>
int main()
{
int n = 25;
for (; ;)
if(n<=50)
cout << "hello";
}
(A) Hello will be printed 25 times
(B) No output
(C) Hello will be printed 50 times
(D) Hello will be printed infinite times
22. Which of the following statements are TRUE about reference variables in
C++ ?
(1) Reference variables are used to provide the new name to the existing
variables
(2) Reference variable create copies of the existing variables
(3) If we made any changes in the reference variable, it will also reflect
in the original variable
(4) The reference variables do not occupy space in memory
(A) (1), (3) and (4)
(B) (1) and (3)
(C) (1), (2) and (3)
(D) (1) and (2)
H-4705 [FT] 8
Page 9
23. What will be the output of the following C++ program ?
#include<iostream.h>
class ABC
{ ABC()
{ int k=0;
if(k)
cout<<"Constructor called Successfully";
else
cout<<"Constructor Failed";
}
};
int main()
{ ABC obj; }
(A) Compiler Error
(B) Constructor Called Successfully
(C) Constructor Failed
(D) None of the above
24. What’s wrong with the following C++ statement ?
while( (i < 10) && (i > 24))
(A) The logical operator && cannot be used in a test condition
(B) The while loop is an exit-control loop
(C) The test condition is always false
(D) The test condition is always true
H-4705 [FT] 9 P.T.O.
Page 10
25. What will be the output of the following C++ program ?
#include<iostream.h>
int main()
{
int k=8;
int m = 7;
int z = k <=++m ? ++k : m++;
cout<<z;
}
(A) 8
(B) 9
(C) 7
(D) 1
26. Consider the following C++ program segment and choose the CORRECT
output.
char t='N';
cout<<t<<"\n"<<t<<"\t"<<t<<"\n"<<t;
(A)
(B)
(C)
(D)
H-4705 [FT] 10
Page 11
27. Evaluate int k = ! (1 && ! (0 1)) ;
(A) 1
(B) 0
(C) 2
(D) Cannot be evaluated
28. Consider the following program and determine the output of the program.
#include<iostream.h>
#include<string.h>
int main()
{
if(strcmp(‘‘GOA’’, ‘‘GOA’’))
cout<<‘‘Welcome’’;
else
cout<<‘‘Visit Again’’;
cout<<‘‘Thank you’’;
}
(A) Welcome
(B) Visit Again Thank you
(C) Visit Again
(D) Welcome Thank you
H-4705 [FT] 11 P.T.O.
Page 12
29. Identify the type of Inheritance depicted in the following diagram.
(A) Multiple Inheritance
(B) Hybrid Inheritance
(C) Multilevel Inheritance
(D) Hierarchical Inheritance
30. Identify the equivalent Boolean expression for the Boolean function
AB + AC.
(A) (AB)’ (AC)’
(B) (A + B) (A + C)
(C) ((AB)’ (AC)’)’
(D) (A + B)’ (A + C)’
31. Write the simplified POS expression for the given K-map.
CD
AB
(A) (B + C) (B’ + C’) (B) (B’ + C) (B + C)
(C) (A + C) (A’ + C’) (D) (A + B) (C + D)
H-4705 [FT] 12
Page 13
32. Which of the following is a CORRECT truth table of Half Adder ?
(A)
(B)
(C)
(D)
H-4705 [FT] 13 P.T.O.
Page 14
33. Consider the following C++ code segment.
class example
{
public: int a,b,c;
Example(){a=b=c=1; } //Constructor
1
Example(float a){a = a; b = c = 1;} //Constructor 2
Example(int a,int b,int c){a = a; b = b; c = 1;} //Constructor 3
Example(int a,int b,float c){a = a; b = b; c = c;} //Constructor 4
};
In the above example of constructor overloading, the following statements
will call which constructors ?
Example obj1(1,2,3);
Example obj2(3);
(A) Constructor 1 followed by constructor 2
(B) Constructor 4 followed by constructor 2
(C) Constructor 3 followed by constructor 2
(D) Type mismatch error
H-4705 [FT] 14
Page 15
34. Determine the output of the following code.
#include<iostream.h>
int g=2;
void create(int &x,int y=2)
{ x=x+g;
y=x-g;
cout<<"\n"<<x<<" "<<y<<" "<<g; }
int main()
{ int g=2;
create(::g,g);
create(g); }
(A)
(B)
(C)
(D)
H-4705 [FT] 15 P.T.O.
Page 16
35. Consider the following class declaration and select the CORRECT missing
code that defines copy constructor for class Book.
class Book
{
int BookNo,Price;
public:Book ()
{BookNo=101;
Price=500; }
Book(Book &b)
{ //missing Code } };
int main()
{
Book B1;
Book B2(B1); }
(A) B2.BookNo=b.BookNo;
B2.Price=b.Price;
(B) BookNo=b.BookNo;
Price=b.Price;
(C) BookNo=b.B1;
Price=b.B1;
(D) b.BookNo=BookNo;
b.Price=Price;
H-4705 [FT] 16
Page 17
36. Consider the following C++ program segment and determine the CORRECT
constructor of class TWO.
class ONE
{ int x;
public: ONE(int z)
{ x=z; } };
class TWO
{
float y;
ONE obj1,obj2;
public: //Missing Constructor of class TWO
};
(A) TWO(inta, int b, float c) : obj1(a),obj2(b)
{ y=c; }
(B) TWO(int a, int b, float c)
{ y=c; }
(C) TWO(int a, int b) : obj1(a),obj2(b)
{ y=1; }
(D) TWO(int a, int b, float c : obj1(a),obj2(b))
{ y=c; }
H-4705 [FT] 17 P.T.O.
Page 18
37. Consider the following C++ program segment and select the CORRECT
missing function call to function input() to assign the data member Itemno
for all 10 objects.
class Item
{
int Itemno;
public: void input( int x)
{ Itemno=x;}
};
int main()
{
int no;
Item obj[10];
for (int i=0;i<10;i++)
{
cout<<‘‘Enter the item no’’;
cin>>no;
//Missing function call
}}
(A) obj[i].input();
(B) obj.input(no);
(C) obj[i].input(no);
(D) obj(i).input[no];
H-4705 [FT] 18
Page 19
38. Consider the following program segment and select the CORRECT missing
code to generate the sum of the following series for n terms;
9+99+999+............
int n, i, t=9;
int sum = 0;
cin>>n;
for (i = 1; i <=n; i++)
{
//missing code }
cout <<"\n The sum of the series = " <<sum<<endl;
(A) sum=0;
sum +=t;
t = t* 10 + 9;
(B) sum=t;
t=t*9+10;
(C) sum+=t;
t=t*9*10;
(D) sum += t;
t = t * 10 + 9;
H-4705 [FT] 19 P.T.O.
Page 20
39. Consider the following class declaration and determine the output of the
following C++ code ?
#include<iostream.h>
class Mammal
{
public:
Mammal(){cout<<"I'm a Mammal\n";}
~Mammal(){cout<<’’Mammal object destroyed\n’’;}
};
class Human: public Mammal
{
public:
Human(){cout<<"I'm a Human\n";}
~Human(){cout<<’’Human object destroyed\n’’;}
};
class Female: public Human
{
public:
Female(){cout<<"I'm a Female\n";}
H-4705 [FT] 20
Page 21
~Female(){cout<<’’Female object destroyed\n’’;}
};
int main()
{
Female F;
}
(A) I'm a Mammal
I'm a Human
I'm a Female
Female object destroyed
Human object destroyed
Mammal object destroyed
(B) I'm a Female
I'm a Human
I'm a Mammal
Mammal object destroyed
Human object destroyed
Female object destroyed
H-4705 [FT] 21 P.T.O.
Page 22
(C) I'm a Human
I'm a Female
I'm a Mammal
Mammal object destroyed
Female object destroyed
Human object destroyed
(D) I'm a Mammal
I'm a Female
I'm a Human
Human object destroyed
Female object destroyed
Mammal object destroyed
H-4705 [FT] 22
Page 23
40. Consider the following C++ program segment and identify the CORRECT
missing function call to function sum() which will add the two objects.
class weight
{
int kilogram, gram;
public: weight(int k, int g)
{ kilogram=k;
gram=g;}
void sum (weight, weight); //function to add two objects of class
weight
} ;
int main ()
{
weight w1(12,450),w2(8,500),w3(0,0);
//Missing function call
}
(A) w1.sum(w2);
(B) sum(w1,w2);
(C) w3=sum (w1,w2);
(D) w3.sum(w1, w2);
H-4705 [FT] 23 P.T.O.