You are on page 1of 26

Page |1

OPG WORLD
SCHOOL
CLASS XII

Computer science (083)


PRACTICAL FILE

NAME : Vinay Kumar


SECTION : B
Page |2

INDEX
S. No. Program Page Teachers
Name Number remarks
1. CALCULAT 6,7
OR
2. HCF OF 8
TWO
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, 14,15
insert and
delete
elements in
a linear list.
7. To get roll 16,17
numbers,
names and
marks of the
Page |3

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 19
file and
display the
number of
vowels
/consonants /
uppercase
/lowercase
characters in
the file.
10. Remove all 20
the lines that
contain the
character 'a'
in a file and
write it to
another file.
11. Create a binary 21,22
file with name
Page |4

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
23
that generates
random numbers
between 1 and 6
(simulates a dice).
13. Program to find
the occurrence
24
of any word in a
string.
14. To count no. of
lines in a CSV
25
file.
15. would read
contents of the
26
file
“STUDENT.DAT
” and display the
details of those
students whose
percentage is
above 75. Also
display number of
students scoring
above 75%.

CERTIFICATE
Page |5

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 :
Page |6

Output :
Page |7

Program – 2
Aim : Write a program to find the HCF of two numbers using
Page |8

functions.

Program :

Output :

Program – 3
Aim : Write a recursive code to find the Factorial.
Program :
Page |9

Output :

PROGRAM – 4
Aim : Write a recursive code to find the sum of N numbers.
P a g e | 10

Program :

Output :

PROGRAM – 5
Aim : Write a recursive code to find the Fibonacci series.
Program :
P a g e | 11

Output :

PROGRAM – 6
Aim : To traverse, search, insert and delete elements in a linear list.
INSERT
Program :
P a g e | 12

OUTPUT :

DELETE
Program:
P a g e | 13

OUTPUT :

SEARCH
Program:
P a g e | 14

OUTPUT :

Traverse
Program:
P a g e | 15

OUTPUT:

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

Program :

OUTPUT :
P a g e | 17

Program – 8
P a g e | 18

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.
P a g e | 19

Program :

Out
put :

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

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.
P a g e | 21

Program :

Output :
P a g e | 22

Program – 12
P a g e | 23

Aim : Write a random number generator that generates random numbers


between 1 and 6 (simulates a dice).

Program :

OUTPUT :

PROGRAM – 13
P a g e | 24

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:
P a g e | 25

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%.
P a g e | 26

Program :

OUTPUT :

You might also like