Question Paper Code : 51224
B.E./B.Tech. DEGREE EXAMINATIONS, APRIL/MAY 2024.
First Semester
Civil Engineering
GE 3151 — PROBLEM SOLVING AND PYTHON PROGRAMMING
(Common to : All Branches)
(Regulations 2021)
Answer ALL questions.
PART A — (10 × 2 = 20 marks)
- 1.
Differentiate Algorithm and Pseudo code.
- 2.
Write any two disadvantages of flowchart?
- 3.
What is the difference between interactive mode and script mode?
- 4.
Mention the features of lists in python.
- 5.
What is 'len' function? Give example for how it is used on strings.
- 6.
How to split strings and what function is used to perform that operation?
- 7.
What is range( ) function and how it is used in lists?
- 8.
What are the advantages of 'Tuple' over 'List'?
- 9.
What is module and package in Python?
- 10.
List few common exception types.
PART B — (5 × 16 = 80 marks)
- 11.(a)
- (i)Explain the steps involved in program development cycle.(8)
- (ii)Write the algorithm, pseudocode and draw the flowchart for the following : (1) Guess an integer number in a range. (4) (2) Towers of Hanoi. (4)(8)
- Or
- (b)
- (i)Explain the design structures in pseudo code.(8)
- (ii)Write the algorithm, pseudocode and draw the flowchart for the following : (1) To find the sum of square root of any three numbers. (4) (2) To find the sum of first 100 integers. (4)(8)
- 12.(a)
Write the following python programs
- (i)Test whether a given year is leap year or not(8)
- (ii)To convert Celsius to Fahrenheit.(8)
- Or
- (b)
Write the following python programs
- (i)To find whether a given number is Armstrong number or not(8)
- (ii)To print Fibonacci series.(8)
- 13.(a)
- (i)Explain call by value and call by reference in python.(8)
- (ii)How to perform a user input in Python? Explain with example.(8)
- Or
- (b)
- (i)Briefly explain about function prototypes.(8)
- (ii)Write a program to check whether entered string is palindrome or not.(8)
- 14.(a)
What are the basic list operations that can be performed in Python? Explain each operation with its syntax and example.
- Or
- (b)
What is Dictionary? Explain Python dictionaries in detail discussing its operations and methods.
- 15.(a)
- (i)Write a program to enter a number in Python and print its octal and hexadecimal equivalent.(8)
- (ii)Explain in detail about namespaces and scoping.(8)
- Or
- (b)
Explain in detail about Python Files, its types, functions and operations that can be performed on files with examples.