Practical Sample Paper

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

ALL INDIA SENIOR SCHOOL CERTIFICATE EXAMINATION (AISSCE)

CENTRAL BOARD OF SECONDARY EDUCATION


FINAL PRACTICAL EXAMINATION 2022-23
SUBJECT : COMPUTER SCIENCE (CODE 083)
SCHOOL CODE : 101010 (SCHOOL VIDYALAYA NAME)
Duration: 03 hours Total Marks: 30

1. Lab Test : Python program for the following. (Any one) 8


(i) Write a program to read a text file and display
(a) Number of vowels in the file
(b) Number of consonants in the file
(c) Number of uppercase and lower case character in the file
(ii) Write a program to read a text file and count the number of occurrence of a
particular word.
(iii) Write a program in python to store rollno and name in a binary file. Search the
record on the basis of roll number and show the name on the screen.
(iv) Write a program to create a binary file with roll number, name and marks, input
a roll number and update the marks.
(v) Write a program to create a csv file to store userid and password. Read and
search the password for given user id.
(vi) Write a program to create a csv file with detail such as bookid, title, author. Read
the csv file and show contents on the screen.
(vii) Write a program to implement the following operation on STACK containing
employee code and name.
a) PUSH
b) POP
c) DISPLAY
(viii) Consider a dictionary with keys as course name and fee as value. Write a
program to push course name in STACK where fee is more than 10000. Pop
and display contents of STACK on the screen.
Course_dict = {‘BSC’:8000, ‘MSC’:12000, ’BCA’:15000, ’PGDCA’:3000, ’MCA’:
30000, ’MBA’:50000}

2. Python SQL Connectivity. 4


Consider a student table in the database school with the following
structure.
rollno name marks
1201 Manish 75
1202 Rita 80
1203 Geeta 67
Fill in the blanks and complete database connectivity program with
appropriate SQL command
1. To insert a record in student table (1234,'Ramesh',55)
2. To change the marks to 80 whose rollno is 1201
3. To delete the record of the student whose rollno is 1202
4. To show the records of those students who score more than
75.

1 |P A G E
import mysql.connector as mydb
mycon = mydb.connect(host='localhost',
user = 'root' ,
passwd = 'password',
database = 'school')
cur = mycon.cursor()
#inserting record
sql1 = ____________________________________
cur.execute(sql1)
mycon.commit()
#updating record
sql2 = ___________________________________
cur.execute(sql2)
mycon.commit()
#deleting record
sql3 = ____________________________________
cur.execute(sql3)
mycon.commit()
sql4 = ____________________________________
cur.execute(sql4)
d = cur.fetchall()
for rec in d:
print(rec)
mycon.close()

3. Practical File 7 Marks


4. Project Work 8 Marks
5. Viva-Voce 3 Marks

Signature Signature
Internal Examiner External Examiner
Name : Name:
Date : Date :
Examiner No. : Examiner No. :

---------------------------------------------------------------------------------------------------------------

2 |P A G E

You might also like