SafiullahRehmani - 12413 Mid Term Paper IICT (105726)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

COLLEGE OF COMPUTING AND INFORMATION SCIENCES

Mid-Term Assessment Fall 2020 Semester

104912,104909,104911
Class Id 105047-105048-49 Course Title IICT
104910-105726
Program BSCS Campus / Shift Main Campus / Morning
th
Date 22 – October 2020 Total Marks 50
Duration 02 hours Faculty Name Azam Khan, Siraj Munir, Ali Babar
Student Id 12413 Student Name Safiullah Rehmani

Instructions:
• Filling out Student-ID and Student-Name on exam header is mandatory.
• Do not remove or change any part of exam header or question paper.
• Write down your answers in given space or at the end of exam paper with proper title “Answer
for Question# _ _”.
• Answers should be formatted correctly (font size, alignment and etc.)
• Handwritten text or image should be on A4 size page with clear visibility of contents.
• Only PDF format is accepted (Student are advise to install necessary software)
• In case of CHEATING, COPIED material or any unfair means would result in negative marking
or ZERO.
• A mandatory recorded viva session will be conducted to ascertain the quality of answer scripts
where deemed necessary.

• Caution: Duration to perform Mid-Term Assessment is 02 hours only. Extra 01 hours are given
to cater all kinds of odds in submission of Answer-sheet. Therefore, if you failed to upload
answer sheet on LMS (in PDF format) within 03 hours limit, you would be considered as
ABSENT/FAILED.
• Understanding the questions is the part of assessment.
• All questions are correct if you think there is any mistake so take your assumption and try to
solve it.
• This paper is open book but not open discussion, so you can use book and class lectures for
getting help but copy paste from any source (lecture slides, book, internet, blog etc.) is strictly
not allowed if you found doing such stuff you’ll get 0 marks. To avoid such conditions, use your
own wording.
• Restrict your discussions to classroom knowledge.
• Use ENTER to accommodate space for your answer.
• All aforementioned policies will be enforced strictly so don’t take it as a joke.
• Actual Marks are 50/2=25
Question #1: [14 Marks]
Part A: Write the name of the Gate and draw its symbol, in which if the one of its inputs are 1 then it’s
all output will be 0.
Part B: Draw the circuit diagram OR truth table for given equation.
Q= (W ⊕ X) + (Y.Z)’
Part C: Convert the following Numbers into target number system. Show all necessary calculation.

• 6428= ? 10

• 97BF16= ?2

• AEF16= ?8

‘_________________________
Your answers:

Question #2: [12 Marks]


Part A: If you have a list of unsorted numbers, then which search do you preferred in term of efficiency?
Linear Search or Binary Search? Explain your answers.

Part B: Apply Bubble Sort OR Insertion Sort algorithm to the following list. Show all the required steps.

11, 59, 33,4,28, 49 so that the sorted list will be 4, 11,28,33,49, 59


Part C: In how many ways can we represent an algorithm? Name and define them.

‘_________________________
Your answers:

Question #3: [12 Marks]

Part A: Consider the following algorithm:

A=5, B=6
C=0
C=A X B
PRINT C
Explain how types of Machine Instructions OR Machine Cycle will be used to fetch, decode and
execute different type of machine instructions on the above program in CPU. Draw a diagram to
support your answer.

Part B: Why RAM is called volatile memory? Discuss in your own words.

. ‘_________________________
Your answers:

Question #4: [12 Marks]

Part A: What do you understand by term LIFO and FIFO, which data structure use these two mechanism
and how? Support your answer with any real life example for both.

OR

Suppose two algorithms A and B runs on same machine to find the factorial of number. Algorithm A
execute in 1 ms, where algorithm B execute in 3 ms, according to you which algorithm is more efficient.
A or B and why? Explain your answers.

Part B: Suppose, in a Stack Top value is 0 and value store at that location is "S" as shown in the following
figure. What will the value of Top after the execution of following Operations? Also show all steps in the
following diagram
.
0
1
2
3
4

6
7 S
• Push("A")
• Pop()
• Push("Q")
• Push(“X”)
• Pop()
• Pop()
• Pop()
• Pop()
• Pop()
____________________________________________________________________

‘_________________________
Your answers:

Best of Luck

Answers
Answer for Ques #1 (a)
Answer for Ques #1(b)
Answer for Ques# 1(c)
Answer for Ques # 2(a)

I will prefer in solving in linear search, because it will sort the


number one by one and it is more safe to Solve that in linear
because there aur less chances of error.

Answer for Ques # 2(b)


Answer for Ques # 2(c)

We can represent alogoritm by 2 ways


1. Primatives
2. Pseudocode

Primatives:-
Algorithm approaches these problems by establishing a well-
defined set of building blocks. Such building block is called
primitive. The representation of an algorithm requires some form
of language perhaps language of pictures.
Example:-
Process to make a boat from a piece of paper.

Pseudocode:-
A pseudo code is a notational system in which ideas can be
expressed informally during the algorithm development process.
It includes condition, statements, IF, Else, For ,While etc
Example:-
If score is greater than 145 then victory else defeat
• If (condition) then (activity)
else (activity)
Answer for Ques # 3(a)

It will use Arithmetic/logic unit to perform the above task by


multiplying A and B resulting answer in C
• It will retrieve the instruction from memory and then it
will proceed
• Then it will decode the instuction register
• Then will perform the task in the instruction register.
Diagram:-
Answer for Ques # 3(b)

Volatile memory is computer storage that only maintains its


data while the device is powered.
RAM (Random Access Memory) used for primary storage in
personal computers is volatile memory. RAM is much faster
to read from and write to than the other kinds of storage in a
computer, such as the hard disk or removable media.
The data in RAM stays there only while the computer is
running when the computer is shut down, RAM loses its
data.

Answer for Ques # 4(a)


Answer for Ques # 4(b)

You might also like