You are on page 1of 43

OPG WORLD

SCHOOL
CLASS XII

Computer science (083)


PRACTICAL FILE

NAME : Vinay Kumar


SECTION : B
INDEX
S. No. Program Page Teachers
Name Number remarks
1. CALCULATOR 6,7
2. HCF OF TWO 8
NUMBERS
3. FACTORIAL 9
USING
RECURSION
4. SUM OF N 10
NUMBERS
USING
RECURSION
5. FIBONACCI 11
SERIES USING
RECURSION
6. To traverse, 12,13,
search, insert 14,15
and delete
elements in a
linear list.
7. To get roll 16,17
numbers,
names and
marks of the
students of a
class and store
these details in
a file.
8. To read a text 18
file line by line
and display each
word separated
by ‘#’.
9. Read a text file 19
and display the
number of
vowels
/consonants
/uppercase
/lowercase
characters in the
file.
10. Remove all the 20
lines that contain
the character 'a'
in a file and
write it to
another file.
11. Create a binary file 21,22
with name and roll
number. Search for
a given roll number
and display the
name, if not found
display appropriate
message
12. Write a random
number generator that
23
generates random
numbers between 1
and 6 (simulates a
dice).
13. Program to find the
occurrence of any
24
word in a string.
14. To count no. of lines
in a CSV file.
25
15. would read contents
of the file
26
“STUDENT.DAT”
and display the details
of those students
whose percentage is
above 75. Also
display number of
students scoring
above 75%.
16. Write a program to
implement stack
29
program
17. SQL Program
30-36

CERTIFICATE

This is to certify that Vinay Kumar of class XII, OPG


World School, Dwarka, New Delhi has successfully completed his
practicals in Computer Science as prescribed by CBSE in the year
2020-2021 under the guidance of Mrs. Anu Joseph.
Date:

Registration No:

Signature Signature
(Internal Examiner) (External Examiner)

PROGRAM – 1
Aim : Write a program to do calculator operations using functions.
Program :
Output :
Program – 2
Aim : Write a program to find the HCF of two numbers using
functions.

Program :

Output :

Program – 3
Aim : Write a recursive code to find the Factorial.
Program :
Output :

PROGRAM – 4
Aim : Write a recursive code to find the sum of N numbers.
Program :
Output :

PROGRAM – 5
Aim : Write a recursive code to find the Fibonacci series.
Program :
Output :

PROGRAM – 6
Aim : To traverse, search, insert and delete elements in a linear list.
INSERT
Program :
OUTPUT :

DELETE
Program:
OUTPUT :

SEARCH
Program:
OU
TPUT :

Traverse
Program:
OUTPUT:

Program – 7
Aim : To get roll numbers, names and marks of the students of a class and
store these details in a file.
Program :

OUTPUT :
Program – 8
Aim : To read a text file line by line and display each word separated by ‘#’.
Program :

OUTPUT :

PROGRAM – 9
Aim : Read a text file and display the number of vowels /consonants /uppercase
/lowercase characters in the file.
Program :
Output :

Program – 10
Aim : Remove all the lines that contain the character 'a' in a file and write it to
another file.

Program :
Output :

PROGRAM – 11
Aim : Create a binary file with name and roll number. Search for a given roll
number and display the name, if not found display appropriate message.
Program :

Output :
Program – 12
Aim : Write a random number generator that generates random numbers between 1
and 6 (simulates a dice).

Program :

OUTPUT :
PROGRAM – 13
Aim : Program to find the occurrence of any word in a string.
Program :

OUTPUT :

Program – 14
Aim : To count no. of lines in a CSV file.
Program:
OUTPUT :

PROGRAM – 15
Aim : Write a function countrec() in Python that would read contents of the file
“STUDENT.DAT” and display the details of those students whose percentage is

above 75. Also display number of students scoring above 75%.


Program :

OUTPUT :
TERM 2

PROGRAM – 16
Aim : Write a program to implement stack operations

Program :
OUTPUT :

SQL PRATICALS
ACTUAL TABLE:
IN :
BETWEEN:

LIKE:
SUM:

AVERAGE:
COUNT:

COUNT*
MAX:

MIN:

ORDER BY:
GROUP BY:

NULL/NOT NULL:
HAVING:

JOIN:

SQL AND PYTHON INTERFACE PRACTICALS


Create connection between Python and SQL
Create a database
Show Databases
Create table

Show tables
Alter Table

Desc Table
Insert Into Table

Update set

Delete
P a g e | 43

Fetchone

Fetchall

Row Count

You might also like