[go: up one dir, main page]

0% found this document useful (0 votes)
21 views17 pages

PYQ Sem 4

The document contains examination question papers for Python Programming and Operating Systems courses at SRM University, detailing the structure of the exams, including parts A and B, with various questions aimed at assessing students' understanding of programming concepts and operating system principles. Each part includes a range of questions that cover definitions, programming tasks, and theoretical explanations related to the subjects. The papers are designed to evaluate students' knowledge and skills in Python programming and operating system functionalities.

Uploaded by

Medhansh Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views17 pages

PYQ Sem 4

The document contains examination question papers for Python Programming and Operating Systems courses at SRM University, detailing the structure of the exams, including parts A and B, with various questions aimed at assessing students' understanding of programming concepts and operating system principles. Each part includes a range of questions that cover definitions, programming tasks, and theoretical explanations related to the subjects. The papers are designed to evaluate students' knowledge and skills in Python programming and operating system functionalities.

Uploaded by

Medhansh Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

SRM UNIVERSITY DELHI-NCR, SONEPAT

Registration No.:
|o&22oo
MST-1 (March-2023)
B. Tech (CSE) IV Semester
Subject Code: 21CS 2012 Duration: 90min
Subject Name: Python Programming Max. Marks: 50

Note: Question Paper consists of two parts (Part-A andPart-B).


AllQuestions are compulsory in Part-A.
Answer any THREE Questions from Part-B

PART A:(10*2)

S.No Question(s) Course Learning


Outcome
Define Python programming language. CLOI
2 Write the various features of Python. CLO1
3 Mention any four popular applications of Python. CLO1
4 Classify the Python data types. CLO3
5 How many modes are available in Python? CLOI
6 What is another name for Comparison operators? CLO2
7 Justify in Python, a programmer cannot use numbers along with
CLO2
Boolean operators.
Find the bugs in the following programs.
Count =0
CLO2
For i inrange(10,0,-1)
print(i)
What are arguments? CLO4
10 How to create a string using a constructor of the str class? CLO3

PART B:(10*3)

S.No Question(s) Course Learning


Outconme
Translate the following algorithm into Python code.
Stepl: Initialize variable named Pounds with value 10.
Step2: Multiply pounds by 0.45 and assign it to a variable CLO2
kilogram.
Step3: Display the value of variable pounds and variable.
Goods Service Tax (GST) calculator:
Stepl: Read cost of production
2 Step2: Input the CGST (Central GST) tax rate. CLO2
Step3:Input the SGST (State GST) tax rate.
Step4: Calculate and print the total cost of theproduct.
3
Write a program to convert a hexadecimal number entered as a CLO2, CLO3
string into its equivalent binary format.
Explain the String operations with necessary example. CLO2, CLO3
SRM UNIVERSITY DELHI-NCR, SONEPAT
Registration No.:
MST-1UMay-2023)
B. Tech (CSE) IV Semester
Subject Code: 21 CS 2012 Duration: 90 min
Subject Name: Python Programming Max. Marks: 50

Note: Question Paper consists of two parts (Part-A and Part-B).


AllQuestions are compulsory in Part-A.
Answer any THREE Questions from Part-B

PART A:(10*2)

S.No Question(s) Course Learning


Outcome
1. What are Frozen Sets? CLO1
2 Differentiate between del and remove commands. CLO1
What is the significance of os.path module in Python? CLO1
4 Prove immutability with an example. CLO1
5 Discuss the concept of negative indexing. CLO4
Let list = ['xl','x2, 'x3, 'x4', 'x5", 'x6']. CLO2
Find a) list[1:3|b) list[:3]c) list[4:]d) list[::2]
7 Advantage of fromkeys() in a dictionary. CLOI
8 outlist-list({5:Five',7:'Seven'} ) CLO1
print(outlist)
What will be the Output?
Define List comprehension. CLO3
10 Give the syntax to convert a list into a tuple. CLO3

PART B:(10*3)
S.No Question(s)( with Marks) Course Learning
Outcome
Write a program in Python to copy the content of one file to another CLO4
file without overwriting the existing file.
2 Write a program in Python to show the inbuilt functions and CLO3
methods available in Tuple.
3 Give ten operations that you can perfom on Lists. CLO3
4 Discuss various modes by which we can open a file. How will you CLO4
check the path given represents a file or adirectory?
Name:

Reg. No.:
Samanth
lo 32|12 oO4
8. What is the use of\ Backslash in python regular expression?
9. Define Dataframes.
10.List out three data structures in pandas.
END TERM EXAMINATION - MaylJune-2023 PART -B
SEMESTER -IV (16*5= 80 Marks)
(B.Tech-Computer Seience &Engineering)
11. a) Explain the working principle and the phases involved in
Subject Code: 21CS 2012 Duration: 3 hours
compilation with neat block diagram. (16 Marks)
Subject: Python Programming Max. Marks: 100 OR
b) A grocery shop decides to give its customers a discount of
Instructions
12.5% on the total purchases if it exceeds Rs. 1000. The
All Questions are compulsory quantity purchased & price per item is entered through the
The Question paper consists of 2 sections - Part A contains 10 keyboard. Write a program to calculate the final sales bill.
questions of 2 marks cach. Part B consists of5 questions of 16 (16 Marks)
Imarks each.
There is no overall choice. Only Part B question include
internal choicc. 12. a) i. Write a program to read a string containing binary digitsand
convert it intoits cquivalent decimal integral. (12 Marks)
PART -A
(2 * 10 = 20 Marks) ii. Discuss the type conversion methods. (04 Marks)
1, Define REPL. OR
2. State the output of following command. b) i. Write a program to calculate compound interest with class
>>>e-6j name Compound_Interest and execute for principal amount as
>>>print(type(c) Rs. 10,000 at rate of interest as 5% and number of years the
3. Convert the following while loop into for loop amount is deposited as 7 years. (10 Marks)
i=0 ii. Write and describe on methods to search a substring in a
s =0
given string with example. (06 Marks)
while i<= 50:
if (1%7 == 0) 13. a) i. Explain the List methods with suitable program. (10 Marks)
s=s+i
i=i+7 ii. Write a function histogram that takes string as
print(s) parameter
and generates a frequency of characters contained in it.
4. What is an index operator? How does it help in accessing (06 Marks)
characters?
5. How are elements of a list reversed? OR
6. What is the role of the * operator within the Zip() functions?
7. Describe pickling module.
b) Consider an ongoing test cricket series has Testl, Test2 &
Test3. Calculate the highest numbers of runs scored by an
individual cricketer in the test series. (16 Marks)
Note: Use Dictionary concept & Run time Input.
14. a) i. Write short notes on inbuilt functions to access file and
directories. (08 Marks)
ii. Write a function Find Largest() which acceptsa file name
as parameter and reports the longest line in the file.
(08 Marks)
OR
b) i. List out and describe the special characters that can be used
in Regular expressions. (06 Marks)
ii. Let assume an individual spends 'x amnount (in three
digits) On 'y' item each month. The amount spent each
month is stored in a file Expense.txt in the format MonthNo:
x\n. Create an application using file handling to calculate the
total amount spends on 'y' item in the last six months.
(10 Marks)
15. a) Build an image histogram viewer, implement a simple class
named ImageViewer and that class will contain helper methods
to:
i. Load Image. (03 Marks)
ii. Separate RGB channels from Image matrix. (03 Marks)
ii. Configure figure and axes (subplots). (03 Marks)
iv. Plot channel Histograms. (03 Marks)
v. Plot the image.
(03 Marks)
OR
b) i. Explain how to crcate custom subplot configuration on plots.
(08 Marks)
ii. Write a program to create bar charts and how to draw
errors
bars.
(08 Marks)
SRM UNIVERSITY DELHI-NCR, SONEPAT
Registration No.: Lo32 2 o 4
MST-1 (March-2023)
B.Tech (CSE)IV Semester
Subject Code: 21CS2006 Duration: 90 min
Max. Marks: 50
Subject Name: Operating System
Note: Question Paper consists of twO parts (Part-A and Part-B).
All Questions are compulsory in Part-A.
Answer any THREE Questions from Part-B

PARTA :( 10*2)

S.No Question(s) Course Learning


Outcome
CLO1
Define the terms:
(a) Dispatcher CLO1
(b) Convoy's Effect? CLO1
and soft CLO2
2 Give two points of differences between hard real time
real time systems.
CLO2
3 Differentiate between Threading & Multithreading.
CLO2
4 What do you understand by the term Ageing?
5 What do you understand by the "degree of multiprogramming"?CLO3 CLO3
6 What are the various Scheduling Criterions?
CLOI
7 Give twO points of differences between Program and Process.
Define Context switching. CLO1
CLO2
9 Mention name and explain any two types of System Calls.

10 Difference between Preemptive and Non-Preemptive Scheduling. CLO1

PART B:( 10*3)


Question(s)\ with Marks) Course Learning
S.No Outcome
term CLOI
Differentiate between Long term Scheduler, Medium
Scheduler and Short term Scheduler.
CLO2
Explain PCB along with architectural diagram. CLO2
to execute with one
Assume that youhave the following jobs
processor:
Burst Time Arrival Time
Job
75 0
0
40 10
2 25 10

3 20 80
4 45 85

Say, RR algorithm is used with q=15.


1. Draw aGANTT
chart.
average turnaround
2. Find the average waiting time and
time.
execute with one CLOI
Assume that you have the following jobs to
processor:
Arrival Time Burst Time
Process
PI
4
P2
2
P3
P4 3

Use Preemptive SJF algorithm.


chart.
1. Draw a GANTT
and average turnaround
2. Find the average waiting time
time.

mn multabain
Jauo
au
Stnings

collitoin
nTav a

Tn put tput Stning


hnaical what w

Constctin
SRM UNIVERSITY DELHI-NCR, SONEPAT

Registration No.:

MST-II(May-2023)
B.Tech (CSE)IV Semester
Duration: 90 min
Subject Code: 21CS2006
Max. Marks: 50
Subject Name: Operating System
(Part-A and Part-B).
Note: Question Paper consists of two parts
AllQuestions are compulsory in Part-A.
Answer any THREE Questions from Part-B

PART A:( 10*2)

S.No Question(s) Course Learning


Outcomne
Write a brief note on RAG? CLO2
Define Co-operating processes? CLO4
3 Write the names of sections that are needed to solve the race CLO3
condition for the list of processes.
4 Give any two advantages of virtual memory. CLO2
CLO3
Explain in brief about "Swap out "and "Swap in".
6 Give any two differences between paging and segmentation. CLO4
CLO2
7 Define Compaction. CLO1
8 What is Page Map Table?
CLO2
Define Belady's Anomaly?
10 What is Demand Paging? CLO3

PART B:( 10*3)

S.No Question(s)(with Marks) Course Learning


Outcomne
What is a Deadlock? Explain the conditions which leads to CLO3
deadlock in a system
2 Explain the concept of segmentation along with architectural CLO3
diagram
3 Draw an architecture to handle a page fault and also write CLO4
relevant explanation to explain the same.
CLO3
4 Consider the list of processes and construct a sate sequence
using Banker's algorithm. Also, explain the various steps.
Process Allocation Max Available
ABCD ABCD ABCD
Po 0012 0012 1520
P 1000 1750
P2 1354 2356
P3 0632 0652
P4 0014 0656
Name:
Reg. No.: Samanth PART B
(16 * 5= 80 Marks)
betwcen each:- (8+8)
11. a) Give any four points of differences
(i) Logical address and Physical address space
END TERM EXAMINATION- MAY 2023 (ii) Multi-tasking and Multi-threading
SEMESTER -IV OR
along
(B.Tech-All Batches)
b) Explain any one Classicalsynchronization problem
with its solution? (8+8)
Subject Code: 21CS2006/CS2006 Duration: 3hours
Subject: Operating Systems Max. Marks: 100
121) Draw and explain the steps involved in handling a page
fault. (8+8)
Instructions OR
any two services offered
All Questions are compulsory b)What is an operating system? Write operating system.(2+2+
The Question paper consists of2 sections - Part A contains by OS? Explain four different types of
10questions of 2marlks each. Part Bconsists of 5questions 3*4)
and
of5 proccsses whose arrival time
of 16 marks cach.
There is no overall choice. Only Part B question include 13-n) Consider the setbelow
internal choice. burst time are given Burst Time
Process ID Arrival Time Priority
PART A 4 2
(2 * 10= 20 Marks) 1
1 3

1. Define Scheduler? 3 2
3 5 5
2. Define time sharing system? 4
5
3. What is Bounded Waiting in Critical Section problem? 5 4
4. Define Dispatcher?
5. Define Real time OS? (i)If the CPU scheduling policy is priority non-preemptive,
6. Explain thesystem call used to create new processes? caleulate the average waiting time and average turnaround time.
7. What is the role of virtual memory? (Higher number represents higher priority) (8)
8. What is the need of page replacement algorithm in operating
system? (i)Ifthe CPUscheduling policy is priorIty preemptive, calculate
9. What do you mean by race condition among dependent the average waiting time and average turnaround time. (Higher
processes? number represents higher priority) (8)
10. Differentiate between Page and Segment?
OR
explain the workine
b) Draw the components of disk drive and
of each component. (8+8)
cxample :- (8+8)
14. a) Explain in detail with an
(i) Semaphores
(i)Address Binding
OR
methods for handling Deadlock?
by What are the four different
(4*4)
Context Switching with the help
15.a) (i) Explain the concept of
of diagram. (5)
between Long term Scheduler,
(ii) Give any three differences
and Short term Scheduler. (6)
Mediunn term Scheduler
between hard rcal time and soft
(iii)Give two points of differences
real time systens. (5)
OR

differences betwecn Threading &


15 b) (i) Give any threc
Multithreading. (6)

(i) What do you understand by the term Ageing? (5)

(iii) What do you understand by the "degree of


multiprogramming"? (5)
SRM UNIVERSITY DELHI-NCR, SONEPAT

Registration No.: o 32 2 | 0 | o 4
MST-1(March-2023)
B. Tech (CSE)IVSemester
Subject Code: 21CS2010 Duration: 90 min
Subject Name: JAVAPROGRAMMING Max. Marks: 50

Note: Question Paper consists of two parts (Part-A and Part-B).


All Questions are compulsory in Part-A..
Answer any THREE Questions from Part-B

PART A:(10*2)
Course Learning
S.No Question(s) Outcome
State two features of java. CLO1
1 CLO1
Howare arrays different in Java?
CLO3
3 Describe the uses of this and super keywords with respect to
inheritarnce.
CLO2
What is polymorphism in Java and its types?
CLO1
Does Java work on WORA? Justify.
CLO1
6 What is garbage collection in java?
CLO2
What are restrictions of static methods?
CLO3
Describe the charAt and replace methods related to String
Define Abstraction.
CLO2
CLOI
10 What is the significance of Java Byte code

PART B:(10*3)
Course Learning
S.No Question(s) Outcome
number is palindrome or CLO3
Write a program to find out whether the given
not
programming? CLO1
2 What are constructors. What is its requirement in
Explain with the program (3+2+5) CLO3
in detail.
Discuss the differences between C and Java
the concept of method CLO2
4 What is Class and Object in Java? Explain
overriding with the help of program. (5+5)
SRM UNIVERSITY DELHI-NCR, SONEPAT
Registration No.:

MST II (May-2023)
B. Tech (CSE) IV Semester
Subject Code: 21CS2010 Duration: 90 min
Subject Name: JAVA PROGRAMMING Max. Marks: 50

Note: Question Paper consists of two parts (Part-A and Part-B).


AlI Questions are compulsory in Part-A.
Answer any THREE Questions from Part-B

PART A:(10*2)
S.No Question(s) Course Learning
Outcome
Distinguish between process and thread? CLO1
2 What are different methods of Graphics class. CLO4
3 Can we declare constructor in Interface? CLO2
4 What are different stages of applet. CLO4
Discuss two ways to implement multithreading in java. CLO3
6 What happens if we don't override run nethod in Java? CLO4
Do abstract class can have concrete methods? Justify the statement CLO1
8 What is diamond problem in Java? CLO3
Can Exception Handling can resolve Exception? Justify your statement CLO3
10 Write two differences between final and finally keyword. CLO2

PART B:(10*3)
S.No Question(s)( with Marks) Course Learning
Outcome
1 Explain the concept of synchronization of threads in java? Expiain with an CLO2
example program.
2 Differentiate between Checked and Unchecked exceptions? CLO3
3 Develop a java program for handling a button clicks? CLO4
4 What are various security issues of applet. Write shot note on Abstract CLO2
Class. (5+5)
Name:
Sanman+th.2 1 o o
Reg. No.:o32 ||
(ii) Differentiate between Java and C.
OR
(8)

b) Discuss the working of JVM in detail. What are the different types of
END TERM EXAMINATION - May-2023 operators present in java? Explain (8+8)
SEMESTER - IV
(B.Tech -CSE-AII Batches) 12.a) Discuss in detail how packages can be delined, creating, and
accessed. Explain the Usage of "Super" keyword, with an example
Subjcct Code:21CS2010 /CS2010 progran. (8+8)
Duration: 3 hours OR
Subject: Java Programming Max. Marks: 100 b) Explain the concept of dynamic binding in detail? What is constructor
Instructions
chaining? Explain with the help of progranm (8+8)
All Questions are compulsory 13.a) What is context switching? Describe the purpose and working of
The Question paper consists of 2 sections - Part A contains 10 sleep () method. (6+10)
questions of 2 marks cach. Part B consists of 5 questions of 16 OR
marks each. b) When should we use the printStackTrace ) method? What are the
Therc is no overall choice. Only Part B question include advantages of using exception handling in Java? (6+10)
internal choice.
PART-A 14. ayWhat is Applet? Write in detail about life cycle of an applct. Why
(2 * 10 = 20 Marks) Javaapplet no longer supported? (S+6+5)

1. What is Autoboxing explain with an example? OR


b) Explain in detail about AWT class hierarchy. (16)
2. Why Java is a pure object-oriented programming language? Elaborate
3. What Is the Order of Method InvOcation in An Applet? 15.a) Explain the concept of Java collection franme. Write a brief overview
4. Explain why Java is Machine Independent. on it.
(16)
5.Why do we nced synchronization in Java?
6. What is the purpose of isAlive() method in Java. OR
7. Differentiate class, abstract class. b) What is Annotation? Discuss different types of Annotation. (16)
8. Can we lhave two extends in Java?
9.What is the significance of Wrapper class in java?
10. How java applets differ from java applications.

PART -B
(16 * 5=80 Marks)
11. a)(i) Distinguish between procedure oriented and object-oriented
programming. (8)
SRM UNIVERSITY DELHI-NCR, SONEPAT
Registration No.:

MST-I(March-2023)
B. Tech (CSE) IV Semester
Subject Code: 21CS2004 Duration: 90 min
Subject Name: Theory of Computation Max. Marks: 50

Note: Question Paper consists of two parts (Part-A and


AllQuestions are compulsory in Part-B).
Part-A.
Answer any THREE Questions from Part-B

A:(10*2)
PART
S.No Course
Learning
Outcome
1 Differentiate between DFA and NFA CLO1
2 Define [-transition and e-closure CLO1

3 What are the limitations of Finite state machines? CLOI

4 Define Mealy machine. CLO1

CLO1
5 Design the FA for the set of strings L = (we {0, 1}*: w has odd parity}. A
binary string has odd parity iff the number of Is in it is odd
6 b (ab*ab*)* a b. CLO2
Show that the regular expressions are equivalent. and

b* a b* (ab*ab*).
7 What is the regular expression for the regular language represcnting the set CLO2
of languages fwE (a, b}*: w has both aa and bb as substrings} CLO2
Prove that regular languages are closed under difference.
CLO2
9 Specify the language L represcnting by the regular expression (1+01)*
CLO2
10 Simplify the regular expression (a U b)* (a Ue) b*

PART B:(10*3)
S.No
Course
Learning
Outcome
CLO1
11 Construct the minimized DFA for the given FA

1|Page
Let = (a, b}. Let M=

12 Construct the epsilon NFA and DFAfor the language that accepts set of CLO1
strings that have atmost three l'sover the Z ={0,1,2) *
13 Show that the following languages are not regular CLO2
(i) L={0|n is a power of2
(ii) L={a% w|w0 {a, b}*, Jw| =k}
(ii) TRAILING-COUNT ={any string s followed by a number of
a's equal to the length of s).
(iv) EVENPALINDROME ={ all words in PALINDROME that
have even length}
14 Using Arden's Theorem, find the regular expression corresponding to the CLO2
following FA:

b|a

DF A

2| Page
Name:

Reg. No.: Samanhos2121 o o 4


10. Does the PCP with two Iists X(0, 0ab, ba) andy=(b ba
a) have a solution?
PARTB
END TERM EXAMINATION - May/June-2023 (16 *5= 80 Marks)
SEMESTER- IV
(B.Tech. (CSE) -Common to AlIBranches Regular/Arrear) 11. a) (i)Construct a DFAequivalent to the NDFA Mwhose
transition diagram is given by the tollowing transition diapram
Subject Code: 21 CS2004/ CS2004 Duration: 3 hours [8 Marks]
Subject: Theory of Computation Max. Marks: 100
a. b
a, b
Instructions
AllQuestions are compulsory
The Question paper consists of 2 sections - Part A contains 10
questions of 2 marks each. Part Bconsists of 5 questions of 16
marks each.
There is no overall choice. Only Part Bquestion include internal
choice. 42
PART-A
(2 * 10 20 Marks)
(ii) Construct a minimum state autonmaton equivalent toan
1. Define Finite automata. automaton whose transition table is given below.
2. List out some applications of FA. [8 Marks]
3. Showthat L= {a'bc*| k >i+j) is not regular.
4. Find a regular expression consisting of all strings over (a, b} State
starting with any number of a's, followed by one or more b's,
followed by one or more a's, followed by a single b, followed
by any number of a's, followed by b and ending in any string
of a's and b's. q2
5. Define LR (k) grammar.
6. Ifa context-free grammar is defined by the productions )
S’ a Sa | bSS ssSb | SbS
show that every string in L(G)has more a's than b's.
7. Define ID of a PDA with example.
8. What is the value ofI Sla, a, Z)) in deterministic PDA.
9. State and prove Rice OR
theorem.

Page 1 of 2
OR
b)Define mealcy machine and moore machine. Discuss with example b Discuss in detail thc properties of fecursive and rccursively
the convcrsion of mealev machine to moore machine.[4+12 Marks] [8+8 Marks]
enumerable languages.
accepting L = wE
12.a) Construct a DFAand then regular grammar
number of b's is 3 mod
ia, b} I Wis a string over a } such that the
[16 Marks]
4}.
OR
b) Discuss in detail the closure properties of regular sets.
[16 Marks]

form gencrating
13.a) Construct the grammars in Chomsky normal [8+8 Marks]
the following:
2 I}.
{a""m # 1, m, n2 1). and (a'b" m, n
OR
Reduce the
b) Explain the procedure to convert CFG to GNF. j4+12 Marks)
following CFG to GNF.
A ’ B|S. B’ C
S ’ ASA |bA.
14. a) i) Construct a pda accepting the set of all even-length
palindromes over fa, b} by empty store. [8 Marks]
ii) Construct a pda Maccepting L= (a'b'c* |i=jorj=k} by final
state. [8 Marks]
OR
b) Construct a pda acepting {a"ba" | m, n >-1} by null store.
Construct the corresponding context-free grammar accepting the
same sct.

15.a) Design a Turing machine. [8+8 Marks]


(i)To recognize all strings consisting of an even number of l's.
(ii) Design a Turing machine over {l. b} which can compute
concatenation function over I. ={1}.Ifa pair of words (W1, W2) is
the input. The output has to be WIW2.

Page 2 of 2

You might also like