NWFP, Public Service Commission, Peshawar.
Competitive Examination for Provincial Management Service, 2008.
Computer Science
Time Allowed: 03 Hours
Max. Marks: 100
Attempt total five questions
Attempt atleast one question from each section
Each question carries 20 Marks
Attempt atleast one question from each section
Each question carries 20 Marks
Section A
Question No. 1
(20) Marks
(A) Suppose we have the following jobs:
(10) Marks
| Job | Arrival time | Burst Time (milliseconds) |
|---|---|---|
| 1 | 0 | 8 |
| 2 | 1 | 4 |
| 3 | 2 | 9 |
| 4 | 3 | 5 |
Find out the average wait time using SJF (Shortest Job First) and RR (Round Robin, with time quantum of 7 millisecond) policies.
(B) What are the necessary conditions for deadlock to occur? Explain briefly.
(10) Marks
Question No. 2
(20) Marks
(A) What is a process? How it is different from a thread?
(10) Marks
(B) What is difference between uniprogramming and multiprogramming?
(10) Marks
Question No. 3
(20) Marks
(A) Describe OSI seven layers model and brief functions of each layer
(10) Marks
(B) What is difference between LAN, WAN and Internet? What is function of Hub, Switch and a Router and at what layer each hardware operates?
(10) Marks
Section B
Question No. 4
(20) Marks
(A) Write program in C++ to read 10 values in an array (assume that you read all values positive). Then change each even value in the array with its half value and each odd value with its double value. After change, count how many values are even and how many values are odd. Display this counting.
(10) Marks
(B) Write a program to generate the following series:
(10) Marks
50 40 30 20 10
60 47 34 21 8
70 54 38 22 6
60 47 34 21 8
70 54 38 22 6
Question No. 5
(20) Marks
(A) Write INSERTION Sort algorithm for an array of n elements.
(10) Marks
(B) Apply Kruskal’s Algorithm to find the Minimum Spanning Tree of the following graph:
(10) Marks
Section C
Question No. 6
(20) Marks
(A) Normalize the following data up to 3rd Normal Form (3NF).
(10) Marks
Result Card
Card No.: 1
Issue date: 3/4/8
Student ID: 111
Student Name: ABC
Student Address: 45-C, XYZ
| Course ID | Course Name | Total Marks | Obtained Marks |
|---|---|---|---|
| 101 | W | 100 | 70 |
| 102 | X | 100 | 60 |
| 103 | Y | 100 | 80 |
| 104 | Z | 100 | 50 |
| Grand Total | 400 | 260 | |
(B) Define the following keys:
Primary Key, Unique Key, Composite Key
4+4+2 (10) Marks
Question No. 7
(20) Marks
(A) The window has (Wl, Wr, Wb, Wt) = (10, 20, 15, 40). Viewport has (Vl, Vr, Vb, Vt) = (40, 300, 80, 400). If p(12, 25) lies on window, find the corresponding point p'(x’, y’) on viewport.
(10) Marks
(B) Given a point P(10, 10). Rotate this point around Q(5, 5) at 90°. What will be the new point?
(10) Marks
2 Views
