Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
80 views3 pages

Practical File Class 12 Cssession 2024-25

Uploaded by

adarshpratap3425
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)
80 views3 pages

Practical File Class 12 Cssession 2024-25

Uploaded by

adarshpratap3425
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/ 3

Class XII 2024-25

Subject : Computer Science (Practical File)


Q.1 Write a Program in python to enter five number and print the smallest of them.

Q.2 Write Program in python to Fibonacci series 0 1 1 2 3 5 8 …………….

Q.3 Given a string in which the letter h occurs at least twice, replace every occurrence of the letter h by
the letter H, except for the first and the last ones.
Example input
In the hole in the ground there lived a hobbit

Example output
In the hole in tHe ground tHere lived a hobbit

Q.4 Given a list of integers, find the maximum element in it. Print its value and its index.

Q.5 Write a code to accept two numbers and display the quotient. Appropriate exception should be
raised if the user should enters the second number (denominator) as zero

Q.6 Create a function rev which will accept a number and returns its reverse

Q.7 Write a function EOReplace() in python which accepts a list L of numbers. Thereafter, it increments
all even numbers by 1 and decrements all odd numbers by 1.

Q.8 Create a function which will accept a number and return whether it is odd or even

Q.9 Write a function in python to count the number of lines in a text file ‘STORY.TXT’ which is starting with an
alphabet ‘A’ .
Q.10 Write a program to read and display file content line by line with each word separated by #
NOTE : if the original content of file is:
India is my country
I love python
Python learning is fun

OUTPUT
India#is#my#country#
I#love#python#
Python#learning#is#fun#

Q.11 : Write a method/function DISPLAYWORDS() in python to read lines from a text file STORY.TXT, and display
those words, which are less than 4 characters.

Q, 12 : Program to create binary file to store Rollno and Name, Search any Rollno and display name if
Rollno found otherwise “Rollno not found”

Q. 13 Program to create binary file to store Rollno, Name and Marks and update marks of entered
Rollno

Q. 14 Program to read the content of file line by line and write it to another file except for the lines
contains “a‟ letter in it.
Q. 15 Program to create CSV file and store empno, name, salary and search any empno and display
name, salary and if not found appropriate message

Q. 16
Write the definition of a user-defined function `push_even(N)` which accepts a list of integers in a
parameter `N` and pushes all those integers which are even from the list `N` into a Stack named
`EvenNumbers`.

Write function pop_even() to pop the topmost number from the stack and returns it. If the stack is
already empty, the function should display "Empty". Write function Disp_even() to display all element of
the stack without deleting them. If the stack is empty, the function should display 'None'.
For example:
If the integers input into the list `VALUES` are:
[10, 5, 8, 3, 12]
Then the stack `EvenNumbers` should store:
[10, 8, 12]

Q. 17 Surya is a manager working in a recruitment agency. He needs to manage


the records of various candidates. For this, he wants the following
information of each candidate to be stored:
- Candidate_ID – integer
- Candidate_Name – string
- Designation – string
- Experience – float
You, as a programmer of the company, have been assigned to do this job for Surya.
(I) Write a function to input the data of a candidate and append it in a binary file.
(II) Write a function to update the data of candidates whose experience is more than 10 years and
change their designation to "Senior Manager".
(III) Write a function to read the data from the binary file and display the data of all those candidates
who are not "Senior Manager"

Q 18. Create the following table and on basis of them write the following queries:
Name :ITEMMASTER TABLE

Column Type SIZE Constraint Description


ITNO INTEGER PRIMARY ITEM NUMBER
NAME VARCHAR 20 NOT NULL ITEM DESCRIPTION
QOH INTEGER DEFAULT QUANTIY ON HAND
CLASS CHARACTER 1 A, B,C CATEGROY OF ITEM
UOM CHARACTER 4 UNIT OF
RATE FLOAT 8,2 UNIT PRICE OF SALE
ITTRAN TABLE

Column Type SIZE Constraint Description


ITNO NUMBER FOREIGN KEY (ITNO) ITEM NUMBER
ITEMMAST
UPD_FLAG CHARACTER 1 Y,N MASTER UPDATED
TRANTYPE 1 I, R TRANSACTION TYPE
TRANDATE DATE CURRENT SYSTEM TRANSACTION DATE
QTY INTEGER TRANSACTION
1 Insert the following rows to itemmaster table?
ITNO NAME QOH CLASS UOM ROL ROQ RATE
1090 HAMMER 234 A PCS 12 34 400
1089 SAW 456 B PCS 17 23 800
2 Increase the rate of ‘B’ Class items by 12%
3. Delete the transaction of item number 1089.
4. Delete the item details for which no transaction have taken place between the last 2 months.
5 Display the Name of items belonging to class ‘A’
6 Display item number, name and quantity of class ‘C’ and their quantity on hand where rate is greater
than Rs. 2000
7 List out the transaction of items for the month of Jan 2013
8 List total issues for each item.
9 List the average receipt of each item.
10 List the items, which have been issued more than 3 times.
11 List all the transaction s between Jan 94 and Aug 94 both inclusive.
12 List the different units of measurement available in the itemmaster table.
13 List the value of the stock of each item. Make sure that the heading will be “value”
14 List the items in ascending order of class and within class, in descending order of rate.
15 List the item name which have ‘MM’ and ‘TT’ in their name.
16 List the name of costliest item.
17 List the value of items rounded to 2 decimal places.
18 List the item number, name , quantity and transaction type of each item.

Q.19. Consider the following two tables STUDENT and LIBRARY as follows.

Table : STUDENT
St_Id. St_ Name Stream Class Book_Issue
101 Karan Science 12B C103
202 Divakar Commerce 11C C104
305 Divya Commerce 12C C102
406 Arun Humanities 12C C101
501 Sabina Science 12A C106

Table : LIBRARY
BookNo. Title Author Pub Issue_Date
C101 Data Structure Lipschtz McGraw 10-Dec-2009
C102 ComputerStudies French Galgotia 15-Oct-2010
C103 AdvancedPascal Schildt McGraw 20-Jan-2009
C104 Dbasedummies Palmer PustakM 8-Sep-2009
C105 MasteringC++ Gurewich BPB 23-Nov-2009

Write a SQL query for que.(i) and (ii) and output for que:(iii)
(i) Display student name,stream book issue and date of issue for each student.
(ii) Display student name,class and total student in particular stream.
(iii) SELECT St_Id,St_Name,Stream,Title,Issue_date FROM STUDENT,LIBRARY WHERE
STUDENT.Book_Issue=LIBRARY.BookNo ORDER BY St_Name.
(iv) Identify the foreign key and primary key in the tables?
(v) Is there any discrepancy in the tables? If Yes state

Q.20. Program to connect with database and store record of employee and display records.

Q. 21. Program to connect with database and update record of employee.

Q.22. Program to connect with database and delete record of employee and display records.

Q.23. Program to connect with database and display records of an employee table where deptno is 20.

You might also like