be_first-year-fe-engineering_semester-1_2024_may_programming-and-problem-solving-pattern-2019
be_first-year-fe-engineering_semester-1_2024_may_programming-and-problem-solving-pattern-2019
8
23
PB3593 [Total No. of Pages : 3
ic-
[6260]-8
tat
F.E.
0s
PROGRAMMING AND PROBLEM SOLVING
3:5
(2019 Pattern) (Credit System) (Semester - I/II) (110005)
02 91
9:3
Time : 2½ Hours] [Max. Marks : 70
0
40
0/0 13
Instructions to the candidates:
1) Solve Q.1 or Q.2, Q.3 or Q.4, Q.5 or Q.6, Q.7 or Q.8.
0
2) Neat diagrams must be drawn weherver necessary.
5/2
.23 GP
8
C
23
b) Explain how we can pass command line arguments in python with a
ic-
suitable example. [6]
16
tat
8.2
0s
using a function. [5]
.24
3:5
91
49
OR
9:3
30
40
Q2) a) Write syntax of function definition and function call. Give a suitable
example for the same. [6]
01
02
5/2
8
23
.23
tat
8.2
0s
.24
3:5
9:3
i) concatenation
30
40
ii) appending
01
02
OR
8.2
.24
P.T.O.
49
[6260]-8 1
Q4) a) Explain string module in python. [6]
8
23
b) Explain following string methods with example. [6]
ic-
i) split()
tat
0s
ii) zfill()
3:5
iii) replace()
02 91
9:3
c) Write a program to reverse a string without using slicing operator. [5]
0
40
0/0 13
0
Q5) a) Explain the following programming Paradigms in detail.
5/2 [6]
.23 GP
i) Procedural
E
ii) Structured
83
8
C
23
iii) Object Oriented
ic-
16
tat
8.2
0s
c) Write a program to create a class ‘Book’ with members, title, author,
.24
3:5
publisher, and ISBN number. The functions of the class should read and
91
49
OR
01
02
8
iii) Inheritance
23
.23
tat
c) Write a program to calculate area of square and rectangle using a class.[6]
8.2
0s
.24
3:5
91
49
i) seek()
5/2
GP
ii) writelines()
0/0
iii) readline()
CE
83
c) Write a program that reads text from a file and writes in into another file
.23
but in the reverse order. (Hint: Make the first line in the original file as the
16
OR
.24
49
[6260]-8 2
Q8) a) Explain the following method with suitable example [6]
8
23
i) getcwd()
ic-
tat
ii) rmtree()
0s
3:5
iii) makedirs()
02 91
9:3
0
b) What is a file path? Explain absolute path and relative path. [6]
40
0/0 13
c) Explain the following dictionary methods. [6]
0
5/2
.23 GP
i) fromkeys()
E
83
8
C
23
ii) setdefault()
ic-
16
iii) update()
tat
8.2
0s
.24
3:5
91
49
9:3
30
40
01
02
5/2
GP
0/0
CE
83
8
23
.23
ic-
16
tat
8.2
0s
.24
3:5
91
49
9:3
30
40
01
02
5/2
GP
0/0
CE
83
.23
16
8.2
.24
49
[6260]-8 3