0% found this document useful (0 votes)
85 views9 pages

HSSC-II Computer Science (2nd Set)

Uploaded by

Amna Khaliq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views9 pages

HSSC-II Computer Science (2nd Set)

Uploaded by

Amna Khaliq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Version No.

ROLL NUMBER


⓪ ⓪ ⓪ ⓪ ⓪ ⓪ ⓪ ⓪ ⓪ ⓪ ⓪
① ① ① ① ① ① ① ① ① ① ①
② ② ② ② ② ② ② ② ② ② ②
③ ③ ③ ③ ③ ③ ③ ③ ③ ③ ③ Answer Sheet No.___________
④ ④ ④ ④ ④ ④ ④ ④ ④ ④ ④
⑤ ⑤ ⑤ ⑤ ⑤ ⑤ ⑤ ⑤ ⑤ ⑤ ⑤
Sign. of Candidate __________
⑥ ⑥ ⑥ ⑥ ⑥ ⑥ ⑥ ⑥ ⑥ ⑥ ⑥
⑦ ⑦ ⑦ ⑦ ⑦ ⑦ ⑦ ⑦ ⑦ ⑦ ⑦
⑧ ⑧ ⑧ ⑧ ⑧ ⑧ ⑧ ⑧ ⑧ ⑧ ⑧
Sign. of Invigilator __________
⑨ ⑨ ⑨ ⑨ ⑨ ⑨ ⑨ ⑨ ⑨ ⑨ ⑨

COMPUTER SCIENCE HSSC–II (2nd Set)


SECTION – A (Marks 15)
Time allowed: 20 Minutes
Section – A is compulsory. All parts of this section are to be answered on this page and handed
over to the Centre Superintendent. Deleting/overwriting is not allowed. Do not use lead pencil.
Q.1 Fill the relevant bubble for each part. Each part carries one mark.
(1) Which of the following phase of SDLC involves training of personnel to use the
new system?
A. System Analysis ⃝ B. System Implementation ⃝
C. System Design ⃝ D. System Coding ⃝
(2) Assume value is an integer variable. If the user enters 333.14 in response to the
following programming statement, what will be stored in value? cin>> value;
A. 333 ⃝ B. 33314 ⃝
C. 333.14 ⃝ D. Compile time error ⃝
(3) Which one of the following Operating system is time bound and has a fixed
deadline?
A. Embedded OS ⃝ B. Distributed OS ⃝
C. Time sharing OS ⃝ D. Real time OS ⃝
(4) What will be the last phase in SDLC?
A. Planning ⃝ B. Design ⃝
C. Maintenance ⃝ D. Coding ⃝
(5) Which one of the following header file is included in program to use setw()
function?
A. iostream.h ⃝ B. stdio.h ⃝
C. iomanip.h ⃝ D. conio.h ⃝
(6) What will be the output of following program segment?
for (i = 1 ;i< 10 ; i = i+ 5) ;
cout<<i<< " \ t ";

A. 11 ⃝ B. 16 ⃝
C. 1 6 11 ⃝ D. Infinite iterations ⃝
Page1of 2
(7) In the following array definition, what value is stored in number [4]?
int number [5] = { 1, 2, 3 };
A. 0 ⃝ B. 1 ⃝
C. 2 ⃝ D. 3 ⃝

(8) What will be printed after executing the following code?


int x = 5;
if ( x++ = = 5)
cout<< " Five ";
else
if ( ++x = = 6)
cout<< " Six ";

A. Five ⃝ B. Six ⃝
C. FiveSix ⃝ D. Compile time error ⃝

(9) Which one of the following is a valid declaration, if a string needs to be store
10 characters?
A. char S[0] ⃝ B. char S [10] ⃝
C. char S [11] ⃝ D. char S [12] ⃝

(10) How many values a function can return at a time?


A. One value ⃝ B. Two values ⃝
C. Three values ⃝ D. Any number of values ⃝

(11) A pointer is a(n):


A. Operator ⃝ B. Data type ⃝
C. Keyword ⃝ D. Variable ⃝

(12) Which one of the following pointer hold address of any type and can be type-
casted to any datatype:
A. Data ⃝ B. Void ⃝
C. NULL ⃝ D. Function ⃝

(13) Which one of the following is FALSE about destructor?


A. It does not accept any argument ⃝
B. It deallocates memory of an object ⃝
C. It can be overloaded ⃝
D. There is always one destructor ⃝

(14) Ofstream is a(n):


A. Command ⃝ B. Class ⃝
C. Object ⃝ D. Method ⃝

(15) Which one of the following is used to open a file for writing and move the
read/write control to the end?
A. ios::ate ⃝ B. ios::in ⃝
C. ios::app ⃝ D. ios::out ⃝

___________

Page 2of 2
Federal Board HSSC-II Examination
Computer Science Model Question Paper
(Curriculum 2009)

Time allowed: 2.40 hours Total Marks: 60


Note: Answer any twelve parts from Section ‘B’ and attempt any three questions from
Section ‘C’ on the separately provided answer book. Write your answers neatly and
legibly.
SECTION – B (Marks 36)
Q.2 Attempt any TWELVE parts from the following. All parts carry equal marks. (123=36)
i. Write down three differences between multi-threading and multi-tasking.
ii. What is the role of Testing/ Verification phase in System Development Life
Cycle?
iii. What is a named constant? Write statements for the following values that create
named constants: (1+1+1)
a. 3.14159 b. 1609
iv. The following C++ code has compile time errors. The line numbers are written
along the left column. They are not part of the program code. Correct at least six
errors in the given code.
1 \* identify and correct errors *\
2 void main(void)
3 {
4 int a, b, s
5 char c = A;
6 cout<< ”enter two numbers;
7 cin>> a >> b;
8 a + b = s;
9 cout<<\n <<s;
10 }
v. Differentiate between declaration and initialization of a variable with example.
vi. a. Write an if-else statement that assigns 1 to x if y is equal to 100, otherwise
it should assign 0 to x. (2)
b. The following statement should determine if count is outside the range of
0 through 100. What is wrong with it? (1)
if (count < 0 && count > 100)
vii. Write down three differences between break statement and exit( ) function.
viii. Write down the output of the following program segments. (1+2)
a) b)
int funny = 7, serious = 15; int i,j;
funny = serious % 2; for(i=1;i<= 4;i++)
switch (funny) {
{ for(j=1;j<=i;j++)
case 1: cout<< "That is funny"; cout<<i * i<<" ";
break; cout<<"\n";
case 7: cout<< "That is serious"; }
break;
case 30: cout<< "That is seriously funny";
break;
default :cout<< funny <<endl;
}
Page 1 of 3
ix. What is the purpose of sizeof( ) function? How do you find the size of an array?
(1+2)
x. Write down any three differences between string and array.
xi. What will be displayed after executing the following code?
int test (int x, int y)
{
return y % x ;
}
void main(void)
{
int a = 3, b = 70, c , d ;
c = test(a , b);
d = test(b , a);
cout<< b << ”\t” << c << “\t” << d <<endl;
}
xii. Compare local and static variables in terms of scope, lifetime, and storage
duration. (1+1+1)
xiii. Write down the purpose of asterisk (*) in the following statements: (1+1+1)
a. distance = speed * time;
b. int *ptr = &n;
c. *ptr = 100;
xiv. What is the relationship between a class and an object?
xv. Write down three differences between a text file and a binary file?
xvi. What is stream? Write down the purpose of the following functions: (1+1+1)
a. getline( ) b. get( )

SECTION–C(Marks24)
Note: Attempt any THREE questions. All questions carry equal marks. (38= 24)

Q.3 a. Explain the following functions of Operating System: (2+2)


a. Memory management b. File Management
b. Write down four differences between pretest and posttest loops. (4)

Q.4 a. Write down four responsibilities of any two personnel involved in System
Development Life Cycle. (2+2)
b. Explain two-dimensional array.Initialize two-dimensional arraysof two different
data types. (2+2)
Q.5 Write a program that computes and displays the charges of a patient stay in hospital.
(3+3+2)
The program should ask if the patient was admitted as an in-door patient or an out-door
patient.
• If the patient was an in-door patient, the following data should be entered:
• The number of days spent in the hospital
• The daily rate
• Hospital medication charges
• Charges for hospital services (lab tests, etc.)
Page of 2 of 3
• If the patient was an out-door patient the following data should be entered:
• Charges for hospital services (lab tests, etc.)
• Hospital medication charges
The program should use two overloaded functions to calculate the total charges. One of
the functions should accept arguments for the in-door patient data, while the other
function accepts arguments for out-door patient information. Both functions should return
the total charges to the main function.

Q.6 a. Explain inheritance with daily life example. (3+1)


b. Define a class declaration named Inventory in a retail store with following
members: (1+1+1+1)
• Private members named item number, quantity, price, and total cost.
• Constructor to the class that initialize item number, quantity, and price to 0.
• Public member function get to accept data of item number, quantity, and
price.
• Public member function display to calculate and print total cost of inventory.

*****

Page3of 3
COMPUTERSCIENCE HSSC-II (2nd Set)
Student Learning Outcomes Alignment Chart
(Curriculum 2009)

Sr Section: Contents and Student Learning Outcomes Cognitive Allocated


No Q. No. Scope Level ** Marks in
Model
(Part Paper
no.)
1 A: 1(i) 2.1 System v) Explain the following: U 1
Development Deployment/Implementation
Life Cycle
2 A:1(ii) 3.3 Input/ Output ii) Explain the use of cin statement U 1
Handling to get input from the keyboard
during execution of the program
3 A: 1(iii) 1.1 Introduction iii) Explain the following types of U 1
to Operating operating system: • Real-Time
System Operating System
4 A: 1(iv) 2.1 System iii) Explain the following K 1
Development Maintenance/Support
Life Cycle
5 A: 1(v) 3.3 Input/ Output vii) Use manipulators endl and setw K 1
Handling
6 A: 1(vi) 4.2 Loops i) Explain the use of the following A 1
looping structures: • For
7 A: 1(vii) 5.1 Introduction iv) Explain how to define and initialize U 1
an array of different sizes and data
types

8 A: 1(viii) 4.1 Decisions i) Explain the use of the following A 1


decision statements: • Else-if
9 A: 1(ix) 5.3 Strings iii) Explain the techniques of U 1
initializing a string
10 A: 1(x) 6.2 Passing iii) Use return statement U 1
arguments and
returning values
11 A: 1(xi) 7.1 Pointers i) Define pointers K 1
12 A: 1(xii) 7.1 Pointers v) Declare variables of pointer types U 1
13 A: 1(xiii) 8.1 Classes v) Define constructor and destructor U 1
• Default constructor/destructor
14 A: 1(xiv) 9.1 File Handling v) Define stream K 1

15 A: 1(xv) 9.1 File Handling ii) Open the file • Modes of U 1


opening file
16 B: 2(i) 1.3 Process iii) Differentiate between: • multi- U 3
Management threading & multi-tasking
17 B: 2(ii) 2.1 System v) Explain the following: • Testing / K 3
Development verification
Life Cycle
18 B: 2(iii) 3.2 C++ iv) Define constant qualifier – const K+U 1+1+1
Constants and
Variables
19 B: 2(iv) 3.1 Introduction v) Explain the purpose of comments U 3 (0.5
3.2 C++ and their syntax each)
Constants and iv) Know the use of a statement
Variables terminator (;)
3.3 Input/ Output v) Explain the process of declaring
Handling and initializing variables
3.4 Operators v) Explain use of the following escape
in C++ sequences using programming
examples
• Newline – \n
iii) Define an expression
20 B: 2(v) 3.2 C++ v) Explain the process of declaring U 3
Constants and and initializing variables
Variables
21 B: 2(vi) 4.1 i) Explain the use of the following U 2+1
Decisions decision statements: • If • If-else
22 B: 2(vii) 4.1 Decisions iii) Use break statement and exit U 3
function
23 B: 2(viii) 4.1 Decisions i) Explain the use of the following U 1+2
decision statements: • Switch-default
4.2 Loops iii) Know the concept of nested loop
24 B: 2(ix) 5.1 Introduction vii) Use the size of ( ) function to find K+U 1+2
the size of an array
25 B: 2(x) 5.1 Introduction i) Explain the concept of an array U 3
5.3 Strings i) Explain what are strings.
26 B: 2(xi) 6.2 Passing i) Pass the arguments: • By value iii) Use U 3
arguments and return statement
returning values
27 B: 2(xii) 6.1 Functions v) Explain the difference between local U 1+1+1
and static variables
28 B: 2(xiii) 3.4 Operators i) Define the following operators and U 1+1+1
in C++ show their use with examples:
7.1 Pointers • Arithmetic operators (*)
iii) Know the use of reference
operator (&) iv) Know the use of
dereference operator (*)
29 B: 2(xiv) 8.1 Classes i) Define class and object K 3
30 B: 2(xv) 9.1 File i) Know the binary and text file U 3
Handling
31 B: 2(xvi) 9.1 File iv) Define stream K 1+1+1
Handling v) Use the following streams • Single
character • String
32 C: 3(i) 1.2 Operating Describe the following main functions K 2+2
System Functions of operating system: • Memory
Management • File Management
C: 3(ii) 4.2 Loops i) Explain the use of the following U 4
looping structures: • For • While • Do- 1.5
while E0.5
0.5
33 C: 4(i) 2.1 System vi) Explain the role of following in the K 2+2
Development system development life cycle •
Life Cycle Management • Project Manager •
System Analyst • Programmer •
Software Tester
C: 4(ii) 5.2 Two i) Explain the concept of a two- K+U 2+2
dimensional dimensional array ii) Explain how to
Arrays define and initialize a two-dimensional
array of different sizes and data types
34 C: 5 6.3 Function iii) Understand the use of function A 3+3+2
overloading overloading with: • Number of
arguments • Data types of arguments •
Return types
35 C: 6(i) 8.1 Classes vii) Understand the concept of K 3+1
following only with daily life
examples: • Inheritance
36 C: 6(ii) 8.1 Classes iii) Understand and access specifier: • A 1+1+1+
Private • Public 1
v) Define constructor and destructor •
User defined constructor/destructor

**CognitiveLevel
K:Knowledge
U: Understanding
A:Application
COMPUTER SCIENCE HSSC-II (2nd Set)
Table of Specification
Unit 1: Unit 2: Unit 3: Unit 4: Unit 5: Unit 6: Unit 7: Unit 8: Unit 9: Cogn
Opera- System Object Control Arrays and Function Pointers Objects File Cogniti itive
ting Develop- Oriented Structure Strings s 5% and Handling Cogniti
Assessment ve level
System ment Life Programmi 15% 15% 15% Classes 10% ve level
Objectives level Total
10% Cycle ng Using 10% %
Marks mark
10% C++ 10%
s: 95
Section 1-v-(01) 1-xi-(01) 1-xiv-(01)
A 4
Knowledge

1-iv-(01)
Section 2-ii-(03) 2-iii-(01) 2-ix-(01) 2-xvi-(03) 30 31.6
B 12
2-x-(01) 2-xiv-(03)
Section 3(04) 4(04) 4(02) 6(04)
C
14
Section 1-iii-(01) 1-i-(01) 1-vii-(01) 1-x-(01) 1-xii-(01) 1-xiii-(01) 1-xv-(01)
A 1-ii-(01) 1-ix-(01) 9
Understanding

Section 2-i-(03) 2-iii-(02) 2-vi-(03) 2-ix-(02) 2-xii-(03) 2-xiii-(02) 2-xv-(03)


B 2-iv-(03) 2-vii-(03) 2-x-(02)
45 47.4
30
2-v-(03)
2-xiii-(01)
Section 3(04) 4(02)
C
6
Section 1-vi-(01)
2
Application

A 1-viii-(01)
Section 2-viii-(03) 2-xi-(03)
B
6 20 21.1
Section 5(08) 6(04)
C 12
Total marks 8 9 12 14 13 15 4 12 8 95 100
KEY: 1-i-(01) Q.No - Part No - (Allocated Marks)
Note: (i) The policy of FBISE for knowledge based questions, understanding based questions and application based questions is approximately 30%
knowledge based,50% understanding based, 20% application based.
(ii) The total marks specified for each unit/content in the table of specification is only related to this model question paper.
(iii) The level of difficulty of the paper is approximately 40% easy, 40% moderate, 20% difficult

You might also like