XII_Final Practical_ cs
XII_Final Practical_ cs
Practical File
Computer Science
Class XII
Session: 2024-25
I express deep sense of gratitude to almighty God for giving me strength for
the successful completion of the project.
The guidance and support received from all my classmates, was vital for
the success of the project. I am grateful for their constant support and help.
INDEX
PYTHON PROGRAMS:
1. WRITE A PROGRAM TO CHECK IF THE ENTERED NUMBER IS ARMSTRONG OR NOT.
2. PYTHON PROGRAM TO CONVERT KILOMETERS TO MILES.
3. PYTHON PROGRAM TO CONVERT CELSIUS TO FAHRENHEIT.
4. WRITE A PROGRAM TO FIND WHETHER AN INPUTTED NUMBER IS PERFECT OR NOT.
5. PYTHON PROGRAM TO DISPLAY UNIQUE VOWELS PRESENT IN THE GIVEN WORD USING STACK.
6. PYTHON PROGRAM TO CHECK PRIME NUMBERS.
7. PYTHON PROGRAM TO PRINT ALL PRIME NUMBERS IN AN INTERVAL .
8. PYTHON PROGRAM TO DISPLAY THE MULTIPLICATION TABLE.
9. PYTHON PROGRAM TO FIND THE FACTORIAL OF A NUMBER.
10. PYTHON PROGRAM TO FIND THE SUM OF NATURAL NUMBERS.
11. PYTHON PROGRAM TO MAKE A SIMPLE CALCULATOR.
12. PYTHON PROGRAM TO CHECK LEAP YEAR.
13. PYTHON PROGRAM TO READ DATA FROM DATA FILE IN READ MODE AND COUNT THE
PARTICULAR WORD OCCURRENCES IN A GIVEN STRING, NUMBER OF TIMES IN PYTHON.
14. PYTHON PROGRAM TO FIND THE SQUARE ROOT.
15. PYTHON PROGRAM TO FIND LCM.
16. PYTHON PROGRAM TO APPEND TO A FILE.
17. PYTHON PROGRAM TO CONVERT TWO LISTS INTO A DICTIONARY.
18. PYTHON PROGRAM TO GET LINE COUNT OF A FILE.
19. PYTHON PROGRAM TO MEASURE THE ELAPSED TIME IN PYTHON.
20. PYTHON PROGRAM TO GET THE FILE NAME FROM THE FILE PATH.
MYSQL PROGRAMS:
1. CREATING THE TABLE(S) OF GIVEN SPECIFICATION AND DISPLAYING THE OUTPUT OF THE
FOLLOWING QUERIES:
• TO DISPLAY THE TRAINER NAME, CITY & SALARY IN DESCENDING ORDER OF THEIR HIRE DATE.
• TO DISPLAY THE TRAINER NAME AND CITY OF TRAINER WHO JOINED THE INSTITUTE IN THE
MONTH OF DECEMBER 2001.
2. CREATING THE TABLE(S) OF GIVEN SPECIFICATION AND DISPLAYING THE OUTPUT OF THE
FOLLOWING QUERIES:
3. CREATING THE TABLE(S) OF GIVEN SPECIFICATION AND DISPLAYING THE OUTPUT OF THE
FOLLOWING QUERIES:
• TO DISPLAY WATCH’S NAME AND PRICE OF THOSE WATCHES WHICH HAVE A PRICE RANGE IN
BETWEEN 5000-15000.
• TO DISPLAY THE RECORDS FROM TABLE STUDENT IN ALPHABETICAL ORDER AS PER THE NAME
OF THE STUDENT.
• TO DISPLAY CLASS, DOB AND CITY WHOSE MARKS ARE BETWEEN 450 AND 551.
• TO DISPLAY NAME, CLASS AND TOTAL NUMBER OF STUDENTS WHO HAVE SECURED MORE
THAN 450 MARKS, CLASS WISE
• TO DISPLAY THE NAME OF CITIES HAVING ORIGIN OF MORE THAN ONE STUDENT .
PYTHON
PROGRAMS
1. PYTHON PROGRAM TO SWAP TWO VARIABLES.
SOURCE CODE:
OUTPUT:
MYSQL
PROGRAMS
TO DISPLAY THE TRAINER NAME, CITY & SALARY IN DESCENDING ORDER OF THEIR HIRE DATE.
• TO DISPLAY THE TRAINER NAME AND CITY OF TRAINER WHO JOINED THE INSTITUTE IN THE
MONTH OF DECEMBER 2001.
TABLE CREATION:
QUERY OUTPUT:
1WRITE A PROGRAM TO CHECK IF THE ENTERED NUMBER IS ARMSTRONG OR NOT.
SOURCE CODE
Out put.
2 Python program to convert kilometers to miles.
Source code
Output
3 Python program to convert Celsius to Fahrenheit.
Source code
Output
4 program to find whether an inputted number is perfect or not.
Source code
Output
5 python program to display unique vowels present in the given word using Stack.
Source code
Output
6 Python program to check prime numbers
Source code
Output
7 Python program to print all prime numbers in an interval
Source code
Output
8 Python program to display the multiplication table.
Source code
Output
9 Python program to find the factorial of a number.
Source code
Output
10. Python program to find the sum of natural numbers.
Source code
Output
11. Python program to make a simple calculator.
Source code
Output
12 Python program to check leap year.
Source code
Output
13 PYTHON program to read data from data file in read mode and count the
Source code
Output
14. Python program to find the square root.
Source code
Output
15. Python program to find lcm.
Sourcecode
Output
16. Python program to append to a file.
Source code
Output
17. Python program to convert two lists into a dictionary.
Source code
Output
18. Python program to get line count of a file.
Source code
Output
19. Python program to measure the elapsed time in Python.
Source code
Output
20. Python program to get the file name from the file path.
Source code
Output
1.Creating the table(s) of given specification and displaying the output of the following queries:
• To display the Trainer Name, City & Salary in descending order of their hire date.
• To display the Trainer Name and City of Trainer who joined the Institute in the month of
December 2001.
• To display number of Trainers from each city.
Table creation
Query output
2. Creating the table(s) of given specification and displaying the output of the following queries:
Table creation
Query output
3.Creating the table(s) of given specification and displaying the output of the following queries:
• To display watches name and price of those watches which have a price range in between 5000-
15000.
• To display watch name and their quantity sold in first quarter.
• To display the quantity sold in each quarter.
• To show the available stock of all the watches.
Table creation
Query output
4.Creating the table(s) of given specification and displaying the output of the following queries:
• To display the records from table student in alphabetical order as per the name of the student.
• To display Class, DOB and City whose marks are between 450 and 551.
• To display Name, Class and total number of students who have secured more than 450 marks,
class wise
• To display the name of cities having origin of more than one student.
Table creation
Query Output