Export
Export
—
‘§
_ Sehaih Amon
2 Q0-B SCS -2 a5 2023
8S Computer Science Mid Term Examination, 311
ir: CE-
Subject: Computer Graphics ia
ax Marks: 30
Time Allowed: 1.5 Hours :
Semester: BScs 4th
Session: 2k21
© Read Questio
i rwriting
n Paper carefully e Avoid cutting / Ove
Note: Attempt
: sn i ? 10marks
i Algorithm?
Draw the Line between the following points using DDA Alg a
F- (5,6) & (8,12)
YF (1,6) & (10,15) |
10 marks
i m
;' i oints using Bresenha ae
Draw the Line between the following p
Algorithm?
~ (9, 18) & (12, 22)
I (4, 3) & (8, 13)
3+2+5
i ks
Solve the following ; 4 mar
A Write an algorithm for Digital differential analyser? CLO 2,3
ae is image-based rendering?
4 idPoint
Draw the Line between (5,9) & (12,16) using MidPoin
Algorithm?
Beat of luck
Page # 2
Department of Computer Science
NFC-IET Multan
Course Name: Database Management System Course No: CS-226
Semester: 4h Mid-Term Exam
Time: 1.5 hours Marks: 30
\a) Candidate key is unique b. Candidate key is the Primary Key of Relation
v. An attribute that can take multiple value against one occurrence of an entity is
called;
}
Q:No.3. State three advantages of the database approach w.r.t the limitations of
the file-based
y approach. (3)
‘0.4. A car rental system has the need to store vehicle details in their system
along with «
customer, rental and employee details. Employee details include his name, employee
number, , *
salary, address, contact and id stored in the system. Employee registers vehicle
which includes,
vehicle id, milage, plate no, chassis no, model, color and vehicle rental rate.
Page # 3
f the vehicle
d damage
Li i ‘
kewise, Customer includes customer number,
Cc
~~. reserves a vehicle where he specifies the vel
ike the di s
oe ay he/she needs the vehicle and number of days h
vailabl
le for rent. The Rent includes rent id, date and meth
composition i
fhe ae if the vehicle is returned accidental.
Wing the scenari
siiah nti nario, create and ER diagram for the given details including all
Entities, attributes
I .
an add exceptions if you think are required/needed.
%
ay 5. An
oe alyze th -
e following tables and answer the queries given accordingly
Note: Be C
areful about the columns and tables names
f Select tu i
student details of the student who has no middle initial
tials 3
¢ )
Select student’
’ s name, course name
: an ,
discrete math course id course completion date for student wh
who is enrolled i
in
(4)
Semester 4th
Marks:30 Time
Question Statements
Question
Numbers
and
_ Find angle
2,45). © fa vector
B = (1,2,3)and W = (4,-1.2)
4
| js an orthogonal Matrix.
A=|2 -1 3
8.
Consider the system
x+2y+2z=1
x+ay+3z=3
x+11y+az=b
db the above system has unique, infinite
ion i real
3B) What are the applications of finite automata and regular nat spi Seed
“world and in the computing domain? You may provide some example:
on your answer.
if
/Q.No.2 (04+02 Marks) ;
¢ A) Generate some strings and Design Finite Automata for the following R.E.
‘ — @ ((a+b)(a+b))’
qa a(a+b)’b+b(a+b)°a
X & @praw transition table for the finite automata given below.
1c Q b
3
Ly ee
Q.No.3 (08 Marks)
pA Consider the language L = {A, ab, aabb, aaabbb, ...} i.e. {a" b" :
n=0,1,2,3,...}
Draw finite automata to express the above language which contains equal number
of a’s and equal number of b’s. If finite automata cannot express this language or
F.A. is not possible list challenges in designing FA for such language.
Page # 6
‘ finite automata
A cxre Fegular expressions and some strings for give below
— automata (b) identify dead-state if any also explain why we require dead-
A
‘) Take intersection Of these two FAs i.e, FAI 1 FA2 and prove Kleene’s theorem
a
and rz = (a+b }"aq ( a~b )" defines Lz and FA; be
Q> a Qsb
BS Computer Science
au Answer the following short Questions. All parts carry equal marks.
y What do you know about Ideology of Pakistan & Two Nations Theory? (4)
SEL AS Fusitl J
fp What do you understand by Bhagti Tehreek? Write names of two hindu Blagats. (4)
Mid Term
CS-2,
24 Design and Analysis of Algorithms
2k21BS Computer Science
Max ks: 30
(141414141) wri
te down th
brute force design techni ame set. oa sequential search algorithms using the
a M ; Cehnique and analyze these algorithms on the following basis.
. Casuring the Input's Size
» Uivite Measuring Running time
c. Orders of Growth
d. w
Worst-Case, Best-Case, and Average-Case Efficiencies
7 [2+1+1+1] Study the following algorithm carefully and try to point out any
inefficiency.
And then convert it into an algorithm which is feasible and efficient. Calculate
time and
return 1;
else
return Fib(N-1) + Fib(N-2)
f [1+2+1] Why use the asymptotic notation in analysis of algorithms. Differentiate
the
lower, upper and tight bound. Discuss the rules of asymptomatic notation.
# [3] Solve the recurrence of the tower of Hanoi by substitution method and find
the time
complexity.
T (n) =2T (n-!) +1
Page 1 of 2
Page # 9
ae ee time complexit
Work. If itis not feasible then apply the code optimization til no further —
" Il Is nol ;
to improve,
J [1.5+1.5]
» 17424,
——-~tn?= n(n+1)(2n+1)/6
p- [3] Sort the list with the help of sequential want / CO aatie. So it
Best of Luck!!!
Page 2 of 2
Page # 10
Database Management System
Final Term (LAB)
Time: 1 hour
Total Marks: 50
| 4 semester 2k21 Muhammad Ahtesham Noor
Attempt All Questions Short Questions: (2x25)=50
Please Read Carefull
What is the difference between MongoDB and the Relational Database management
system
list some importance of MongoDB?
Orders
ord_no purch_amt ord_date customer_id salesman_id
70201 158.5 2812-10-05 3005 5002
702889 270.65 2012-09-10 3001 5005
79282 65.26 2012-10-85 3002 5001
78004 116.5 2012-08-17 3009 5203
70087 948.5 2012-09-10 3005 5002
70285 2408.6 2012-07-27 3007 5001
72028 5768 2012-09-18 3002 5001
70218 1983.43 2012-10-16 3004 5006
70003 2480.4 2012-18-19 3009 5003
70812 250.45 2012-06-27 3008 5002
| 70811 75.29 2012-08-17 3003 5007
70013 3045.6 2012-04-25 3002 5001|
(P.T.O)
Page # 11
Customer
lesman_id
city | grade | sa 1B!
customer_id | cust name $4. 5 Sa oe Geicstee pesetess= —
tees 3e02 | Mick Rimando | New — So 5001
3007 | Brad Davis | Hew Yor 500 | 5002
3005 | Graham Zusi | California | | aan
3008 | Julian Green | London | aaa} 5096
3004 | Fabian Johnson | Paris | ai caas
3009 | Geoff Cameron | Berlin \ oe} 5007
3003 | Jozy Altidor | Moscow {2 oie
3001 | Brad Guzan | London |
Salesman
salesman_id | name | city | commission
nerceecccccn pessscobet ssa feses He Fr 23S FF3SF
Ze complete records (orders, customer) from both tables without apply Condition
‘¥ From the following tables write a SQL query to find those orders where the order
amount exists
between 500 and 2000. Return ord_no, purch_amt, cust_name,city?
* From the customer and salesman tables, find those customers whose grade less than
300: return
cust_name, customer city, grade, Salesman, salesman city. The result should be
ordered by
ascending customer_id?
BEST OF LUCK
Page # 12
Session: 2k21
Beat of buck
Page # 13
Final T.
- erm
S-224 Design and Analysis of Algorithms
2k21BS Com
Puter Science
/ Time: 180 minutes NFC-IET Multan
Max Marks: 50
7 (3+2] Briefly
describe th ; :
Pseudocode, Provide the pie how use the constructs to write down the
algorithms? € example to solve the same problem with multiple
. [5] According t ; .
f [24241] + dg - Asymptotic notation show that (1/2)n?-3n = O(n")
Master’s theo: Tecurrence relation by substitution method, telescopic sum and
rem. Also write the time complexity in asymptomatic notation.
[14242] Whi _ Ta) =2T (0/2) +n whereas T (1) = 1 :
a ich One is better among the insertion sort and heap sort? Prove it on the basis
i. design techniques and complexity.
. — Identify the purpose of Depth-First Search and Breadth-First Search graph
gorithms. Solve the graph problems according to decease and conquers. Compare the
graph algorithms on the complexity basis? Discuss the data structure of each.
o— ee
Dated: 05/06/2023
[2.5+2.5] Construct the AVL tree and 2-3 tree for the given below list by complete
steps.
/ > - iD
. Prove the time complexity of 2-3 trees in the given below equality.
log,G7 + 1)-- 1 <4 = loga@ +) 1
. [2+2+1]Write down the efficient algorithm of Binomial coefficient after using the
| complete steps of dynamic programming. Find out the space and time complexity
also.
gp
HW nm
{= ford<k Sn.
| [ki K(n-k)!
, [2+2+1] According to the greedy technique, if multiple programs are given and
write
down on multiple tapes then how calculate the Optimal Storage on Tapes, Scheduling
Problem, and mean retrieval time (MRT)?
Best of Luck!!!
Page # 14
| johaiv Nsom - (
2K2O-BSCS~ 7.22
Paper: CE-311 a)
Time Allowed: 3 Hours i 4 7
Semester: BSCS 4" oe a ae ;
Session: 2k21 wc = \
} Given the centre point coordinates (4, 4) and radius as 10, generate all 10 marks
the points to form a circle using Midpoint algorithm? Make the points ii
for all the quadrants and octants of a circle?
f Given the centre point coordinates (10, 10) and radius as 10, generate 10 marks
all the points to form a circle using Bresenham Algorithm? Make the CLO!
points for all the quadrants and octants of a circle?
f f Given a triangle with coordinate points AG, 4), BO6, 4), C(5, 6). Apply 5 marks
the reflection on the X axis and obtain the new coordinates of the CLO2
object.
5 marks
CLO 3
) / Given a 3D object with coordinate points A(O, 3, 1), BG, 3, 2), 5 marks
C(3, 0, 0), D(0, 0, 0). Apply the translation with the distance | towards CLO2
X axis, 1 towards Y axis and 2 towards Z axis and obtain the new
coordinates of the object.
/ Calculate the points between the starting coordinates (20, 10) and 5 marks
ending coordinates (30, 18) using mid-point line drawing algorithm CLO 1
» Beat of buck
Page # 15
"ei <
Tu DME CNG,
stoma
ang (10)
Q.Nb.2 (10)
Cofsider the language L = {A, ab, aabb, aaabbb, ...} 1-e. {a° Bb": 60,1.23,---}
Draw PDA to express the above language which contains equal number of a’s and
equal number of b’s. Consider string aaaabbbbA and run this string on your
design PDA showing changes in the input tape and Stack step by step.
-No.3 (5+5)
Construct incrementing machine for binary language (0,1) and show
relationship between input and output for the following input binary string
1110001111
p Running the string abbabbba over the below Mealy machine and show input
and output relation along with states
Page # 16
in Turing Mach;
sph (10) bprogram for insertion represented in Turing Machin,
c9fisider the following subp'
)
(FM
Run following string on this Turing machine and show each step while traversing
thorough the TM and also mention the resultant string. Insert “b” at entry point
STS STE
Q.M0.5 (04+06(02+02+02))
& Differentiate between Mealy and Moore machine and its applications
Consider the given below context free grammar (CFG) and convert it into F.A,
also identify terminals and non-terminals in this grammar and generate some
strings.
. SDaA
S> bB
A> aS
A>Da
B> bs
B>b
DAW Rw
Page # 17
Course N: .
Fe aii is: aa
A factory has employees who work on the basis of salary and hourly rates, Salaried
employees have an
and hourly employees have per hour rates to define their income. Further, employees
r° Bisse
out in the factory, engineers may have different types ¢-8- electrical engineer OF
mechanical a" »
secretary has typing speed and technicians have technicians’ grade as their
specialized attributes. ail
employees will have empno, name, father name, dob, and address to be stored.
basis can go for overtime job and in that case, it will have an hourly rate for ov
can be hired for only one out of four positions discussed earlier.
‘ Marshal, Daddy's : \
| | Little Girls fy seer |
ober Phi SP Avenue ___Clash of the Tans cM. ‘
(6)
ticed
ization can be prac!
f.4. Discuss any two situations where denormalizat ,
: sang Thy and all transactions are
tions Tl ’ggume that the data for
foha Kav
Aline Stewart
Select complete details of all properties which are owned by “Tony Shaw”. (Use sub-
query) 4
Select propertyno and ownemo of property with highest rent 3
Page # 19
sete of Engineering and
gechnology, Multan
sho
Defin
Pa-t? +3146
Define subspace and determine whether
we{ ab
umbers
‘ Question Statements
AN
Date: 4.06.23
Max. Time: 2:00 Hours
Max Marks: 50
Q.o.1: ane the following short Questions. All parts carry equal marks. (5 x 4 = 20)
CLO.2 PLO.6
OH LS yu 6 550 on, iS ua giles cf ually natihe J 7?
/, Write four contradictory points of Nehru Report & 14 points of Quaid-e-Azam.
When, where & who presented Lahore Resolution? Who presided over the
session?
Q.N¢.2: Describe the main initial problems faced by the newly born state of
Pakistan. (15)
CLO3 PLO.7
Q.1jo.3: Write five different & five similar points among the 1956, 1962 & 1973
constitutions of Pakistan.
(1S)
CLO.3. PLO.7
PEA RSIS ie Ay a iD Ole OS yan 8S 2S UL