18CSC207J-Advanced Programming Practices Lab Record
18CSC207J-Advanced Programming Practices Lab Record
Practices
Lab Record
BONAFIDE CERTIFICATE
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.
Technology, Kattankulathur.
Examiner-1 Examiner-2
INDEX SHEET
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.
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.
Output: 3, 4
2. Write a Python class to reverse a string word by word. Input string : 'hello .py' Expected
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
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-
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
OUTPUT-
RESULT- GUI paradigm is successfully executed.
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.
NETWORK PROGRAMMING
Aim: To implement Network Programming
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-
1. Ram 90
2. Raju 45
3. Priya 85
4. Carol 70
5. Shyam 80
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
10.Usingmatricessolvethelinearequations
3x+7y=12z
4x-2y=5z