BAHRIA COLLEGE ANCHORAGE
PRE BOARD EXAMINATION 2020
Class: XII Subject: Computer Science
Time allowed: 20 Minutes Max Marks: 15
Name: ___________________________________ Class/Section: ___________
Roll No.: __________________________________ Date: ___________________
COMPUTER SCIENCE HSSC-II
SECTION – A (Marks 15)
NOTE: Section-A is compulsory. All parts of this section are to be answered on the question paper
itself. It should be completed in the first 10 minutes and handed over to the invigilator.
Deleting/overwriting is not allowed. Do not use lead pencil.
Q.1 Encircle the correct option A/B/C/D. Each part carries one mark. [10]
(i) ! ¿x==30) can also be written as?
A) x<30 && x>30 B) x<30 ││ x>30
C) x<=30 ││ x>=30 D) x<30 && x>30
(ii) Which of the following operator has the highest precedence?
A) && B) =
C) ! D) <=
(iii) If x = 4 and y = x++ than what will be the value of y?
A) 3 B) 4
C) 5 D) 6
(iv) Which phase of SDLC determines the objective of the project and considers the requirements to
produce the product?
A) Defining phase B) Planning phase
C) Analysis phase D) Requirement Engineering phase
(v) How many bytes are set aside by the compiler for a variable of type unsigned int?
A) 2 B) 4
C) 6 D) 8
(vi) Which function is used to join two words?
A) strcpy() B) strcat()
C) strncon() D) strlen()
(vii) If the two strings are identical, then strcmp() function returns
A) 0 B) 1
C) -1 D) True
(viii) How many bytes are set aside by the compiler for a variable of type long int?
A) 2 B) 4
C) 6 D) 8
(ix) In general, the index of the first element in an array is:
A) -1 B) 0
C) 1 D) 2
(x) Which of the following creates user group and assigns privileges to them?
A) Process management B) I/O management
C) File management D) Network management
Class: XII Page 1 of 4 Subject: Computer Science
(xi) Which of the following is used to display a question mark?
A) \? B) ?
C) \?\ D) “?”
(xii) A constructor is called whenever
A) A class is used B) An object is used
C) An object is created D) A class is declared
(xiii) If x=100 and y=100 then what will be the output of the instruction:
(x>y)? printf (“Hello”) : printf (“Pakistan”);
A) Hello B) Pakistan
C) Hello Pakistan D) None
(xiv) A process is in ______ state when it is not under execution.
A) New B) Blocked
C) Terminated D) Ready
(xv) Which DOS command is used copy files from one drive to another
A) CPY B) COPY
C) MOVE D) CD
Class: XII Page 2 of 4 Subject: Computer Science
BAHRIA COLLEGE ANCHORAGE
PRE BOARD EXAMINATION 2020
COMPUTER SCIENCE HSSC-II
Class: XII Subject: Computer Science
Time allowed: 2:40 Hours Total Marks Section B, C and D: 60
SECTION – B (Marks 21)
Q.2 Attempt any seven parts. All parts carry equal marks. [7 × 3 = 21]
i. What is meant by file management and why it is important?
ii. Differentiate between time-sharing and real-time operating system.
iii. Explain what is meant by requirement validation and requirement management.
iv. What is the purpose of maintenance phase of SDLC?
v. Differentiate between assignment operator and equal to operator.
vi. Evaluate the following expressions:
a) 7*(3+4)>=50 && 7*(3-1)<50
b) 10/2*5+5%2*3-7
vii. What is the output of following program segment:
int n, sum;
sum=0;
for ( n=1; n<=12; n+=2)
{
sum=sum+n;
cout<<sum<<endl;
}
viii. What will be the output of the following code when user enters 1 as value of n?
switch (n)
{
case 1:
cout <<” The number is 1” <<endl;
case 2:
cout <<” The number is 2” <<endl;
break;
default: cout <<” The number is not 1 or 2” <<endl;
}
ix. Convert the following code into switch statement:
void main(void)
{
char grade;
cout<<” Enter grade of student A to C:\t “;
cin>>grade;
if (grade==’a’ ││grade==’A’)
cout<<”Excellent”;
else if (grade==’b’ ││grade==’B’)
cout<<”Well Done”;
else if (grade==’c’ ││grade==’C’)
cout<<”Poor performance”;
else
cout<<”Invalid Letter”;
}
x. What is pointer? How it is declared and initialized?
SECTION – C (Marks 21)
Class: XII Page 3 of 4 Subject: Computer Science
Q.3 Attempt any seven parts. All parts carry equal marks. [7 × 3 = 21]
i. Define array and write down its advantages in programming.
ii. Write down the use of following functions.
a) strcat( ) b) strlen( ) c) strcmp( )
iii. For the given array:
int arr[15]={4,8,5,1,3,5,0,12,5,7,3,15,8,4,11};
Write a program that prints the number of times the number 5 appears in the array.
iv. What is function overloading? Also write any three benefits of function overloading.
v. Differentiate built in and user defined functions.
vi. What is meant by scope of variable? Also explain static scope?
vii. Describe inheritance and polymorphism.
viii. What is encapsulation?
ix. Describe different types operations performed on the files.
x. What is the use of eof( ) function? Write down rules for using eof( ).
SECTION – D (Marks 18)
Note: Attempt any three questions. All questions carry equal marks. [06 × 3 = 18]
Q.4 a) Briefly explain design, coding and deployment phases of SDLC. (03)
b) Write down rules for specifying variable names. (03)
Q.5 a) What is decision control structure? Explain all of its types with examples. (06)
Q.6 a) Explain actual and formal parameters with the help of an example. (03)
b) Write a program that reads an integer and prints its factorial. (03)
Q.7 Write a C++ program to read a number from keyboard and then pass it to a function to
determine whether it is even or odd. (06)
Class: XII Page 4 of 4 Subject: Computer Science