0% found this document useful (0 votes)
78 views4 pages

Practical File XII Computer SC 2024-25

Uploaded by

darkevil2781
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)
78 views4 pages

Practical File XII Computer SC 2024-25

Uploaded by

darkevil2781
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/ 4

KALKA PUBLIC SCHOOL, ALAKNANDA

Practical File Questions


Class XII 2024-25
Subject: Computer Science
1. Write a menu driven program (using functions) to find
a. Factorial of a number
b. Sum of digits of a number
c. Check if the number is an Armstrong number
d. Check if the number is a palindrome

2. Write a menu driven program (using functions) to


a. Count the number of uppercase/lowercase/vowels/spaces in a string
b. Reverse the words of a string (eg. I am in Class XII -> XII Class in am I)
c. Has at least 3 vowels and 2 uppercase characters
d. Encrypt the string by replacing every even-index character with the
succeeding character, every odd-index character with preceding character,
every number by 7 and every special character by # (eg. Word Limit 9 ->
Xnsc#Kjljs#7)

3. Write a menu driven program (using functions) to


a. Reverse a list using with slicing and without slicing
b. Shift the elements of a list to right/left by n, n taken from the user.
c. Remove duplicates from a list
d. Reverse the words in a list of strings (eg. [‘list’,’tuple’,’string’] ->
[‘tsil’,’elput’,’gnirts’])

4. Write a menu driven program to illustrate any 5 functions of a dictionary.

5. Write a menu driven program to


a. Write 4-5 lines to a text file.
b. Read the text file line by line and display each word separated by a #.
c. Remove all the lines that contain the character `a' in a file and write it to
another file.
d. Count the number of vowels/ consonants/ uppercase/ lowercase characters
in the file.

6. Write a menu driven program to


a. Write 4-5 student records in a binary file (in the form of a dictionary as
{rollno: 1, sname: “abc”, smarks: 90, sage: 16})
b. Search for a given roll number and display the name, if not found display
appropriate message.
c. Input a roll number and update the marks.

7. Write a menu driven program to


a. Write 4-5 student records in a CSV file (fields as above)
b. Search for a given roll number and display the name, if not found display
appropriate message.
c. Input a roll number and update the marks.
Page 1 of 4
8. Write a 2-player game using random number generator that generates random
numbers between 1 and 6 (simulates a dice). Each player gets to throw the dice 3
times consecutively. The first player to get a sum of 15 wins the game.

9. Write a password generator program using the random module to generate a 8-


character password with the following conditions:
a. At least one character is uppercase
b. At least one character is a number
c. At least one character is either ‘@’ or ‘#’

10. Write a menu driven program to implement the functions of a stack (PUSH and
POP). Display the value of top and content in stack after each operation. The
stack must consist of a single string (at least 8-10 characters) input by the user.

11. Write a menu driven program to implement the functions of a stack (PUSH and
POP). Display the value of top and content in stack after each operation. The
stack must consist of records, where each record comprises of stock_id,
stock_name and stock_price.

Python – SQL connectivity programs

12. Using Python-MySQL connectivity


a. Create a book table (book number, book name, author name, number of
pages, book price, genre, date of publication).
b. Insert at least 8-10 records

13. Using the book table above, perform the following:


a. Display all records
b. Display records based on multiple conditions (using AND, OR, NOT in
WHERE clause)
c. Display records illustrating the usage of pattern matching
d. Find book(s) printed in a particular year as input by the user
The conditions must be taken from the user in Python program and passed via
connector to database

14. Using the book table above, perform the following:


a. Update book price of books of a specific author input by the user
b. Delete records of books whose number of pages is less than a number input
by the user
The conditions must be taken from the user in Python program and passed via
connector to database

15. Using the book table above, perform the following:


a. Find minimum, maximum and average price of books
b. Find book(s) having least number of pages in a specific genre
c. Find sum of book price per genre

Page 2 of 4
SQL Queries

16. With reference to the following relations (tables) EMPLOYEE and JOB complete all
the queries in your practical file.
Create following tables EMPLOYEE and JOB such that Empno and Sno are not null
and unique, name is never blank, Area and Native place is valid, hobby, dept is not
empty.
Table: EMPLOYEE

1. Show empno, name and salary of those who have Sports as hobby.
2. Show name of the eldest employee.
3. Show number of employee area wise.
4. Show youngest employees from each Native place.
5. Show Sno, name, hobby and salary in descending order of salary.
6. Show the hobbies of those whose name pronounces as ‘Abhay’.
7. Show the appointment date and native place of those whose name starts with ‘A’ or
ends in ‘d’.
8. Show the salary expense with suitable column heading of those who shall retire after
20-jan-2006.
9. Show an additional burden on the company in case the salary of employees having a
hobby as sports, is increased by 10%.
10. Show the hobby of which there are 2 or more employees.
Page 3 of 4
11. Show how many employee shall retire today if maximum length of service is 20
years.
12. Show those employee name and date of birth who have served more than 17 years as
on date.
13. Show names of those who earn more than all of the employees of Sales dept.
14. Show names of those who earn more than at least one of the employees of Marketing
dept.
15. Increase salary of the employees by 5 % of their present salary with hobby as Music
or they have completed atleast 3 years of service.
16. Show the maximum salary and the hobby of employee.
17. Count the number of employees in each department.
18. To display the maximum, minimum, sum and average salary of each department.
19. To display ename in lower case and job in upper case.
20. To display employees name, salary and Area of all the employees working in Agra
21. Add a new tuple(row) in the table essentially with hobby as Music.
22. Insert a new column email in job table
23. Create a table with values of columns empno, name, and hobby.
24. Erase the records of employee from job table whose hobby is not Sports.
25. Remove the table EMPLOYEE.

Page 4 of 4

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy