G12 Practical File 2024-25
G12 Practical File 2024-25
1. Create a menu driven program to calculate the area of the following shapes based on user’s choice:
1. RECTANGLE
2. SQUARE
3. TRIANGLE
4. PARALLELOGRAM
5. CIRCLE
2. Create Number Guessing Game in Python using random module.
3. Write a Python program to accept a string from the user and create a menu to :-
a. Check whether it is palindrome or not.
b. Display number of characters,
c. No of words,
d. No.of lower case letters,
e. No. Of uppercase letters
f. No. of digits in the string.
4. Create a Python program to accept a list of numbers from the user then display the highest number and
lowest number. Also display the reverse of the list.
5. Write a menu driven program to input names of n students, total marks, average and result and store in a
nested tuple. Display the following menu:
a. Result: Display name, marks, average and assign result as “pass” if average is more than 32 and
“fail” if less than 33.
b. Display: Display name, total marks and average of all students.
c. Search: Accept name and display other details if found and display not found if doesn’t exist.
d. Merit list: Display students getting average marks above 74.
6. Write a menu driven program to accept and store Employee name as key and his salary, allowance and
deductions as value in a dictionary for 10 employees. Display the following:
a. Display the total salary.
b. Display total allowance and deductions.
c. Search an employee
7. Write a Python program to create a list for storing the first 12 terms of Fibonacci series.
8. Create a Python program to have the following functions:
a. A function that takes a number as an argument and calculates its cube. If there is no value passed to
the function, it should calculate the cube of 5.
b. A function that receives two strings and checks whether they are the same length string or not. It
should return True if both are the same length string otherwise False
9. Write a program to create a text file “Story.txt” and do the following:-
a. Display the number of blanks present in the file.
b. Display the number of lines present in the file.
c. Display the number of capital letters present in the file.
d. Display the number of words present in the file.
e. Display the number of lowercase letters present in the file.
10. Write a program to read the text file “Poem.txt” and display it content after replacing every space by #
11. Create a text file “My School.TXT” with some information regarding your school. Read the content of the file
“My School.TXT” and display the following:
a. No of characters in the file.
b. Number of vowels present in the file.
c. Number of consonants present in the file.
d. Number of words start with “A”
12. Write an interactive menu driven program to perform the following operations on a data file “customer.dat”
which stores the information such as Customer_Id, Cust_Name, and Cust_City as a list.
1. Insert a record
4. Display records.
13. Create a binary file “Student.dat” has structure [admission_number, Name, Percentage]. Write a function
that would read contents of the file student.dat and display the details of those students whose percentage
is above 75 in new file named “percentage.dat”.
14. Create a CSV file called “contact.csv” to store name and contact number of any 10 students. Write a function
to display the content of the file.
15. Create a CSV file “books.csv” to store BOOKID, BOOKNAME, AUTHOR and PRICE as a tabular form: Write it as
a menu driven program to do the following:-
16. Create a menu driven program to do the following stack (EMP )operations:-
EMP[EMPID,ENAME]
1. Push
2. Pop
3. Display
4. Exit
17. Create a menu driven database connectivity program to do the following transaction on a MySQL table EMP
(EMPNO,ENAME,JOB,SALARY,DOB,ADDRESS,DEPTNO).
1.Create
2.Insert
3.Display
4.Exit
18. Create a menu driven database connectivity program to do the following transaction on a MySQL table
TEACHER (TID,TNAME,DESIGNATION,SALARY,DATEOFJOINING,PHONENUMBER,ADDRESS).
1.Create
2.Insert
3.Delete
4.Exit,
19. Create a menu driven database connectivity program to do the following transaction on a MySQL table
BANK(ACC_No, Name, Acc_Balance, Mobileno, Email)
1.Create
2.Insert
3.Update
4.Exit
20. Create a menu driven database connectivity program to do the following transaction on a MySQL table MOV
(MOVNO,TITLE,TYPE,RATING,STARS,QTY,PRICE).
1.Create
2.Insert
3.Search
4.Exit
21.SQL Program
Refer the following tables and answer the following questions:-
Age Integer 2
DOJ Date
Gender Char 1
Q4. Display the names of female students who are in Hindi department.
Q5. Display the names of all students with their date of joining in ascending order.
Q8. Insert a new row in the table with the following data.
Admn No : 145, Name : John, Age: 19, Department : Computer, DOJ: 2016-09-20, Gender:Male
Q9. Display the number of distinct departments.
Q11. Display the student details whose name start with ‘A’
Table: Department
Dept Dname Minsal Maxsal HOD
10 Sales 25000 32000 1