ALL INDIA SENIOR SCHOOL CERTIFICATE EXAMINATION: 2024-25
SUB : COMPUTER SCIENCE PRACTICAL (083)
CLASS : XII
SCHOOL CODE : 15315
Maximum Marks : 30 Time : 3 Hrs
MARKING SCHEME
GENERAL INSTRUCTIONS & Questions:
A. Programming in Python. [8+4=12]
1. Write any one program in Python.
Marking Scheme [8 Marks]
(i) Logic: 60%
(ii) Documentation / Indentation: 20%
(iii) Code Quality: 20%
2. SQL queries (4 queries based on one or two tables) [4 Marks]
Q1.
(i) import pickle
def countrec():
fobj=open("[Link]","rb")
num = 0
try:
records=[Link](fobj)
for rec in records:
if rec[2]>75:
num = num + 1
print(rec[0],rec[1],rec[2])
except:
[Link]()
return num
n=countrec( )
print("Number of records is:",n)
Output :
1 Namita Panigrahi 87.0
3 Dinesh Mohanty 92.0
5 Geeta Kar 89.0
Number of records is: 3
(ii)
import pickle
def createfile():
fobj=open("[Link]","ab")
BookNo=int(input("Enter Book Number : "))
Book_name=input("Enter book Name :")
Author = input("Enter Author name: ")
Price = int(input("Price of book : "))
rec=[BookNo, Book_name ,Author, Price]
[Link](rec, fobj)
[Link]()
createfile()
def countrec(Author):
fobj=open("[Link]", "rb")
num = 0
while True:
rec=[Link](fobj)
if Author==rec[2]:
num = num + 1
print(rec[0],rec[1],rec[2],rec[3])
return num
n=countrec("Sumita Arora")
print("Total records", n)
Output:
Enter Book Number : 1005
Enter book Name :Computer Science
Enter Author name: Sumita Arora
Price of book : 650
101 Comp Sc Sumita Arora 500
Total records 1
101 Comp Sc Sumita Arora 500
Total records 1
(iii)
def DISPLAY():
file=open('[Link]','r')
line=[Link]()
while line:
if line[0]=='P' :
print( line)
line=[Link]()
[Link]()
DISPLAY()
Output:
Python is a high level programming language.
Python language uses interpreter.
(iv)
(a)
import csv
def ADD( ):
field = ["Rollno", "Name" , "Marks"]
f = open("[Link]" , 'w')
d=[Link](f)
[Link](field)
ch='y'
while ch=='y' or ch=='Y':
roll=int(input("Enter the roll number: "))
name= input("Enter the Name: ")
mark=int(input("Enter the marks: "))
rec=[roll, name, mark]
[Link](rec)
ch=input("Enter more record??(Y/N)")
[Link]()
ADD()
(b)
def Display():
f = open("[Link] " , "r",newline='')
data = [Link](f)
next(f)
for row in data:
if len(row)!=0:
if int(row[2])>80:
print(row)
[Link]()
Display()
Output:
['1', 'Ashok Kumar Das', '91']
['2', 'Sukanti Panda', '95']
['4', 'Manoj Das', '83']
(v)
s=[]
c="y"
while (c=="y"):
print("Choice : 1. PUSH ELEMENTS INTO THE STACK")
print("Choice : 2. POP ELEMENTS FROM THE STACK")
print("Choice : 3. DISPLAY ELEMENTS OF THE STACK")
choice=int(input("Enter your choice: 1/2/3:"))
if (choice==1):
a=input("Enter any number :")
[Link](a)
elif (choice==2):
if (s==[]):
print ("Stack is Empty")
else:
print ("Deleted element is : ",[Link]())
elif (choice==3):
l=len(s)
for i in range(0,l):
print(s[i])
else:
print("Wrong Input !!!")
c=input("Do you want to continue or not?(y/n)")
Output:
Choice : 1. PUSH ELEMENTS INTO THE STACK
Choice : 2. POP ELEMENTS FROM THE STACK
Choice : 3. DISPLAY ELEMENTS OF THE STACK
Enter your choice: 1/2/3:1
Enter any number :46
Do you want to continue or not?(y/n)y
Choice : 1. PUSH ELEMENTS INTO THE STACK
Choice : 2. POP ELEMENTS FROM THE STACK
Choice : 3. DISPLAY ELEMENTS OF THE STACK
Enter your choice: 1/2/3:
Q2.
(i) UPDATE GRADUATE SET STIPEND=STIPEND+100 WHERE SUBJECT=’PHYSICS’;
(ii) SELECT NAME FROM GRADUATE WHERE NAME LIKE ‘D%’;
(iii) SELECT ROLLNO, NAME, SUBJECT FROM GRADUATE ORDER BY NAME DESC;
(iv) SELECT SUBJECT, SUM (STIPEND) FROM GRADUATE GROUP BY SUBJECT;
“OR”
(i) SELECT AVG(SALARY) FROM EMPLOYEE
GROUP BY DEPTID;
(ii) SELECT NAME, DEPTNAME FROM EMPLOYEE, DEPARTMENT
WHERE [Link]= [Link]
AND SALARY>50000;
(iii) SELECT NAME FROM EMPLOYEE
WHERE SALARY IS NULL ORDER BY NAME;
(iv) SELECT DISTINCT DEPTID FROM EMPLOYEE;
B. Practical File :
• Minimum 15 Python programs.
• SQL Queries – Minimum 5 sets using one table / two tables.
• Minimum 4 programs based on Python - SQL connectivity. 7 Marks
C. Project Work : (Project Report, Presentation on computer and viva) 8 Marks
D. Viva Voce : 3 Marks
Signature of Internal Examiner Signature of External Examiner
Examiner No. ______________ Examiner No. ______________