0% found this document useful (0 votes)
59 views

18CSC207J-Advanced Programming Practices Lab Record

This document is a lab record for an Advanced Programming Practices course taken by a student named Gopi Vardhan V during the second year of their Bachelor of Technology degree in Block Chain Technology specialization at SRM Institute of Science and Technology. It contains the student's registration details and 13 experiments completed as part of the course, covering programming paradigms like structured, procedure-oriented, object-oriented, declarative, GUI-based, functional, parallel and concurrent, and network programming. The lab record was certified by the lab in-charge and submitted for university examination.

Uploaded by

gopi vardhan
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)
59 views

18CSC207J-Advanced Programming Practices Lab Record

This document is a lab record for an Advanced Programming Practices course taken by a student named Gopi Vardhan V during the second year of their Bachelor of Technology degree in Block Chain Technology specialization at SRM Institute of Science and Technology. It contains the student's registration details and 13 experiments completed as part of the course, covering programming paradigms like structured, procedure-oriented, object-oriented, declarative, GUI-based, functional, parallel and concurrent, and network programming. The lab record was certified by the lab in-charge and submitted for university examination.

Uploaded by

gopi vardhan
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/ 41

18CSC207J- Advanced Programming

Practices
Lab Record

Register Number: RA2011050010055


Name: Gopi Vardhan V
Section: V1
Department: DSBS
Specialization: Block Chain Technology
Semester: IV
Year: II
SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
S.R.M. NAGAR, KATTANKULATHUR -603 203

BONAFIDE CERTIFICATE

Register No. RA2011050010055

Certified to be the Bonafide Record of Work done by Gopi Vardhan V of CSE Specialization in
Block Chain Technology, B. Tech Degree course in the Practical 18CSC207J- Advanced
Programming Practices in SRM Institute of Science and Technology, Kattankulathur
during the academic year 20212022.

Date: Lab In-charge

SRM Institute of Science Submitted for University Examination held in and

Technology, Kattankulathur.

Examiner-1 Examiner-2
INDEX SHEET

Exp. Date of Name of the Experiment Page Marks Staff


No. Experiment No. (10) Signature

1. 22-03-2022 Structured Programming 1-3

2. 29-03-2022 Procedure Oriented Programming 4-5

3. 12-04-2022 Object Oriented Paradigm 6-8

4. 29-04-2022 Declarative Programming 9-13

5. 13-05-2022 GUI Based Programs 14-15

6. 13-05-2022 Event and GUI Based Programming 16-20

7. 20-05-2022 Functional Programming 21-23

8. 07-06-2022 Parallel and Concurrent Programming 24-25

9. 07-06-2022 Network Programming 26-29

10. 14-06-2022 Logic Programming 30

11. 14-06-2022 Automata Programming 31-34


12. 14-06-2022 Symbolic Programming 35-37

13.

14.
STRUCTURED PROGRAMMING
Aim: To implement Structured Programming Paradigm

1. Develop a python program using decision control structure find the leap years between
the year limit 2000 to 2025.

2. Develop a python program to check the given number is Armstrong number or not using
iteration control structures.

3. Solve the towers of Hanoi problem using recursive function in python language (n=3
discs)
4. Develop a python code declare the function swap and perform swapping operation of
two numbers without using temp variables.

5. Develop a python program which should have all function prototypes to perform any
four arithmetic operations.
RESULT – Thus, structural programming is executed successfully.

PROCEDURE ORIENTED PROGRAMMING


Aim: To implement Procedure Oriented Programming
1. Write a Python function to Find Factorial of Number using Recursion. The function
accepts the number as an argument.
2. Write a Python function to Display Fibonacci Sequence using Recursion .

3. Write a Python function to check whether a number is in a given range.

4. Write a Python function that prints out the first n rows of Pascal's triangle.
5. Write a Python function that takes a list and returns a new list with unique elements of
the first list.

RESULT – Thus, procedure-oriented programming is executed successfully.

OBJECT ORIENTED PARADIGM


Aim: To implement Object Oriented Paradigm
1. Write a Python class to find a pair of elements (indices of the two numbers) from a given
array whose sum equals a specific target number.

Input: numbers= [10,20,10,40,50,60,70], target=50

Output: 3, 4

2. Write a Python class to reverse a string word by word. Input string : 'hello .py' Expected

Output : '.py hello'

3. Define a class named Shape and its subclass Square. The Square class has an init function
which takes a length as argument. Both classes have a area function which can print the
area of the shape where Shape's area is 0 by default.
4. Define a class named Rectangle which can be constructed by a length and width. The
Rectangle class has a method which can compute the area.

5.Write a Python class to find validity of a string of parentheses, '(', ')', '{', '}', '[' and '].
Thesebrackets must be close in the correct order, for example "()" and "()[]{}" are valid
but "[)","({[)]" and "{{{" are invalid.
RESULT- Thus, object-oriented paradigm is executed successfully

DECLARATIVE PROGRAMMING PARADIGM

Aim: To implement Declarative Programming Paradigm


1. Create the below table and execute the insert, update and the below select statements.
i) Write a query to display the total number of recipes available with the
description “Chinese”
ii) Write a query to display the id, name of the recipes with chef_id 'BL000002' iii)
Write a query to display the description of the recipes whose name begins with
'P'.

OUTPUT-

2. Create a table movie of the below structure and assume data types.Movie_ID,
Movie_Name, Genre, Language, Rating ,Do the following queries
a. Update the movies rating by 10% and display it
b. Delete the movies with movie_id 102
c. Select movies whose rating is more than 3.
OUTPUT-

3. Create a course database with the following fields Product(ID, Prod_name,


Supplier_id,Unit_price,Package,OrderID),OrderItem(ID,Order_id,Product_id,Unit_price,
Quantity) using Foreign key
d. Display the total quantity of every product in the stock
e. Sort the Unit_price based on the supplier_id
f. Display the Product_name along with order_id and supplier_id
4. Write a SQL lite3 statement to create a table named as job including columns
job_id,job_title,Min-salary,Max_salary.job_id column does not contain any duplicate
value at the time of insertion
OUTPUT-

5. Write a SQL lite3 statement to create a table names as job_history including columns
employee_id, start_date, end_date, job_id and department_id and make sure that, the
employee_id column does not contain any duplicate value at the time of insertion and
the foreign key column job id contain only those values which are exists in the jobs
table.
RESULT- Thus, Declarative programming paradigm is successfully executed
GUI BASED
Aim: To implement GUI Based Programs

Customer Loan Details

OUTPUT-
RESULT- GUI paradigm is successfully executed.

EVENT AND GUI BASED PROGRAMMING

1. AIM - Design a registration form using tkinter


OUTPUT-

RESULT - Thus, the given program is executed successfully.


2. AIM: To create the given design.
OUTPUT-
RESULT- Thus, the given program is executed successfully.
FUNCTIONAL PROGRAMMING
Aim: To implement Functional Programming
1. Write a lambda function to convert measurements from meters to feet.

2. Passing and returning a function as an argument.Define a function ‘square’ for


squaring a number. Define a function named twice’ that takes a function f as an
argument and returns f(f(x)). Using ‘twice’ and ‘square’ create a function ‘quad’
that takes n as an argument and returns n4 ‘quad’ should not be defined
explicitly. It should only be created as a variable which is then assigned a
function.

3. In a lottery system, random number is chosen by retrieving the number from a


random index from a list of random numbers. Write a program to choose a
random number in this way. You must use nested functions – the inner function
chooses a number from a random index and the outer function generates a
random list of numbers. The outer function takes n as a parameter where is the
maximum number that can be put in the random list.
4. A secret message needs to be sent. Use the map function to encrypt the message
using Caesar cipher.

5. Given runs scored by 2 players in a series of matches, write a Python program


using reduce function to find who is the better player of the two in terms of
maintaining consistency.

6. The marks scored by a class of students in 5 different subjects are stored in a list
of lists. Using the filter function, write a program to find the students who failed
in one or more subjects.

8. Find the difference in age between the oldest and youngest family members, and
return their respective ages and the age difference.
9. The given input is a string of multiple words with a single space between each of
them. Abbreviate the name and return the name initials.

10. If the given input is an array of numbers, return the sum of all the positives ones.
If the array is empty or there aren't any positive numbers, return 0.

RESULT- Thus, functional programming is executed successfully.

PARALLEL AND CONCURRENT PROGRAMMING


Aim: To implement Parallel and Concurrent Programming
1. Create Simple Client Server Application using TCP Socket where server issue a command
which will be executed at the client slide as a process of remote command execution.
OUTPUT-
RESULT- Parallel and concurrent programming is executed successfully.

NETWORK PROGRAMMING
Aim: To implement Network Programming

1. Write a Socket-based Python server program that responds to client messages as


follows:
When it receives a message from a client, it simply converts the message into all
uppercase letters and sends back the same to the client. Write both client and server
programs demonstrating this.
server.py

client.py
OUTPUT –

2. Write a ping-pong client and server application. When a client sends a ping message to the
server, the server will respond with a pong message. Other messages sent by the client can
be safely dropped by the server.
server.py

client.py
OUTPUT-

RESULT- Network programming paradigm is successfully executed.


LOGIC PROGRAMMING
The following are the marks scored by 5 students student Name Mark

1. Ram 90
2. Raju 45
3. Priya 85
4. Carol 70
5. Shyam 80

Print student name and mark of all students

OUTPUT-
RESULT- Logic programming paradigm is successfully executed.

AUTOMATA PROGRAMMING
Aim: To implement Automata Programming
1. Write a deterministic automata code for the language with∑={0,1} accepts the set
of all strings with three consecutive 1's.

OUTPUT-

2. Write a deterministic automata code for the language L(M)={w| w ε{0,1}*} and W
is a string that does not contain consecutive 0's.
OUTPUT-

3. Write a deterministic automata code for the language with∑={0,1} accepts even
Number of 0's and even number of 1's

OUTPUT-
4. Give a non-deterministic automata code for the language L that have at least
Two consecutive 0’s or1’s.

OUTPUT-

5. Write a deterministic automata code for the language with∑={0,1} accepts the
Only input 101.
OUTPUT-

6.Write a deterministic automata code for the language with∑={0,1}accepts Those string

which starts with 1 and ends with 0.

RESULT- Automata programming paradigm executed successfully.


SYMBOLIC PROGRAMMING
Aim: To implement Symbolic Programming
1. Calculate under root 2 with 100 decimals.

2. Calculate 1/2+1/3 in rational arithmetic.

3. Calculate the expanded form of (x+y)6.

4. Simplify the trigonometric expression sin (x)/cos (x)


5.

6.Calculate the derivative of log(x),1/x, sin(x),cos(x)for x.

6. Solve the system of equations x+y=2,2x+y=0

7. Integrate x2,sin(x),cos(x) in terms of x and y


8. Solve f''(x)+9f(x)=1

10.Usingmatricessolvethelinearequations
3x+7y=12z
4x-2y=5z

RESULT- Symbolic programming executed successfully.

You might also like