2020 11 03SupplementaryBE101 05BE10105 I Ktu Qbank
2020 11 03SupplementaryBE101 05BE10105 I Ktu Qbank
D Pages: 3
PART A
Answer all questions, each carries 2 or 3 marks. Marks
1 Differentiate data bus, address bus and control bus. (3)
2 What is the role of translators in computers? Give examples. (3)
3 Give the various flowchart symbols and their use. (3)
4 Write an algorithm for swapping two integers. (3)
5 What are Boolean expressions? Give example Boolean statements in Python
(3)
and its output.
6 What will be the output of the following program segment?
i=5
while i<0:
print i (3)
i=1
else:
print “Sorry”
7 What are the advantages of using functions? (3)
8 Write a python function to read the sides of a triangle a, b and calculate the
(3)
hypotenuse using the formula √(a2 + b2).
9 Let str=‟String operations in python‟. What will be the output of the following
expressions: (2)
i. str[ : -2] ii. str[ : ] iii. str[10 : ] iv. str[-6 : -2]
10 Write a Python program to read a string and use appropriate string operation to
print the string 20 times in a line with no space. Do not use any iterative
(3)
statement.
11 Write a Python program to read a string and find the number of vowels and
(3)
consonants in the string.
12 Let r1 and r2 be the objects of the class rank. Give the output of the following
code.
Page 1 of 3
>>> r1=rank()
>>> r1.a=44
>>> r1.b=22
>>> r2=rank() (3)
>>> r2.a=44
>>> r2.b=22
>>> r1 is r2
13 What is pickling? Give example. (3)
14 List the different file operating modes in Python? (2)
PART B
Answer any four full questions, each carries 8 marks.
15 a) What are secondary storage devices? Explain any two. (5)
b) Give the functions of accumulator, IR and MBR. (3)
16 Formulate an algorithm and draw a flowchart to solve a quadratic equation. (8)
17 Using „while‟, write a Python program to print the multiplication table of n,
2<=n<=10. Replace the „while‟ statement with an equivalent „for‟ statement to (8)
get the same output.
18 Write a Python function to compute the power of a number. Use the function to
(8)
compute the sum of the series (1- x2/2 + x4/4 - x6/6+..........n terms).
19 a) What are the functions of an operating system? (3)
b) Write a Python function to find GCD (greatest common divisor) of two
(5)
numbers.
PART C
Answer any two full questions, each carries 14 marks.
20 a) Write a Python program to find the transpose of a matrix using list. (7)
b) Write a Python program to read numbers stored in a file and separate the even
and odd numbers to two files named Even.txt and Odd.txt respectively. Display (7)
both the files.
21 a) Create a dictionary with items and number of units of each item available in the
stock. Write a Python program to show the stock updation as and when the units (7)
of the existing items are added or deleted.
b) Explain the concepts of classes, attributes and methods in Python, with suitable
(7)
examples.
22 a) Write a Python program to create a list of strings. Separate palindromes in the
(7)
list to another list without using reverse( ) function.
Page 2 of 3
Page 3 of 3