Class 12 CS Practical QP 2023

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

AISSCE COMPUTER SCIENCE

SET A
PRACTICAL EXAMINATION 2022-2023

School Code :
School Name :
Class : XII
Subject Code : 083
Subject : COMPUTER SCIENCE(NEW)
Reg.No : ___________________________
Date & Day :
Max.Marks : 30
Time : 3:00 HRS
Q.No Description Marks

PART – I (Python Program)

Q1. Write a Menu Driven Python program to find Factorial and Sum of List of [8]
numbers Using Function.

PART - II (Python Connectivity)


Q2. Complete the following Database connectivity program by writing missing
statements and perform the given query. [4]
TABLE: Students
Roll Name Age Percentage
1 Arun 24 65
2 Ankit 21 71
3 Anu 20 80
4 Bala 19 67
5 Charan 18 95
6 Usha 23 82

The code given below inserts the following record in the table "Students":
Rollno - integer, Name- string , Age –integer, Percentage - integer
Note the following to establish connectivity between Python and MYSQL:

➢ Username: root
➢ Password: root
➢ The table exists in a MYSQL data base named "School".
➢ The details (Roll no, Name, Age, Percentage) are to be accepted from
the user.
import ___________________ as sql # Statement 1
con1=sql.connect(host="localhost",user="root",password="root",
database="school")
mycursor=_______________ #Statement 2
print("Students with Percentage greater than 75 are : ")
_________________________ #Statement 3
data=__________________ #Statement 4
for i in data:
print(i)
print()

con1.close()
(a) Complete the Statement 1 by writing the name of library/Package
need to import for database.
(b) Complete the Statement 2 to form the cursor object.
(c) Complete the Statement 3 to by writing the execution query that
extracts records of those students whose Percentage is greater than
75.
(d) Complete the Statement 4 to read the complete result of the query
(records whose Percentage is greater than 75) into the object named
data, from the table student in the database.
Q3. Practical Record (Report File) [7]
Q4. Project file [8]
Q5. Viva Voce [3]

Internal Examiner External Examiner


[Mr/Mrs.________] [Mr/Mrs.__________________]
[EXTERNAL NUMBER: _________]
AISSCE COMPUTER SCIENCE
SET B
PRACTICAL EXAMINATION 2022-2023

School Code :
School Name :
Class : XII
Subject Code : 083
Subject : COMPUTER SCIENCE (NEW)
Reg.No : ___________________________
Date & Day :
Max.Marks : 30
Time : 3:00 HRS
Q.No Description Marks

PART – I (Python Program)


Q1. Write a python program to read text file "Story.txt" and display the number
[8]
of vowels/consonants/lower case/ upper case characters present in that
text file.

PART - II (Python Connectivity)


Q2. Complete the following Database connectivity program by writing missing [4]
statements and perform the given query.
TABLE: EMP
EmpId Name Salary
1001 Baskar 45000
1002 Roja 71000
1003 Anu 55000
1004 Manoj 82000
1005 Kavitha 36000

The code given below inserts the following record in the table "EMP":
EmpId - integer, Name- string , Salary –integer.
Note the following to establish connectivity between Python and MYSQL:

➢ Username: root
➢ Password: root
➢ The table exists in a MYSQL data base named "Employees".
➢ The details (EmpId, Name and Salary) are to be accepted from the
user.
import ___________________ as sql # Statement 1
con=sql.connect(host="localhost",user="root",password="root",
database="Employees")
eno=int(input("Enter Employee ID : "))
name=input("Enter name : ")
sal=int(input("Enter Salary : "))
cur=______________________ # Statement 2
Q=______________________ # Statement 3
cur.execute(Q)
con._______________ #Statement 4
print("Employee Details are stored Successfully")
con.close()
(a) Complete the Statement 1 by writing the name of library/Package
need to import for database.
(b) Complete the Statement 2 to form the cursor object.
(c) Complete the Statement 3 by writing the query that inserts the record
in the table EMP.
(d) Complete the Statement 4 to add the record permanently in the
database.
Q3. Practical Record (Report File) [7]
Q4. Project file [8]
Q5. Viva Voce [3]

Internal Examiner External Examiner


[Mr/Mrs.________] [Mr/Mrs.__________________]
[EXTERNAL NUMBER: _________]
AISSCE COMPUTER SCIENCE
SET C
PRACTICAL EXAMINATION 2022-2023

School Code :
School Name :
Class : XII
Subject Code : 083
Subject : COMPUTER SCIENCE (NEW)
Reg.No : ___________________________
Date & Day :
Max.Marks : 30
Time : 3:00 HRS
Q.No Description Marks

PART – I (Python Program)


Q1. Write a Python Program to Create a binary file "Students.dat" to store roll
[8]
number, name and Search for a given roll number and display the name,
if not found display appropriate message.

PART - II (Python Connectivity)


Q2. Complete the following Database connectivity program by writing missing [4]
statements and perform the given query.
TABLE: Books
BookId BName Price Author
1001 C++ 250 Prakash
1002 Java 375 Sumita
1003 Python 575 Preethi
1004 HTML 200 Harish
1005 C# 500 Manoj

The code given below inserts the following record in the table "Books".
BookId - integer, PName- string , Price –integer, Author - string
Note the following to establish connectivity between Python and MYSQL:

➢ Username: root
➢ Password: root
➢ The table exists in a MYSQL data base named "Bookshop".
➢ The details (Bookid, BName, Price, Author) are to be accepted from
the user.

import ___________________ as sql # Statement 1


mycon=sql.connect(host="localhost",user="root", password="root",
database="Bookshop")
cur=______________________ # Statement 2
Q=______________________ # Statement 3
cur.___________(Q) #Statement 4
mycon.commit()
mycon.close()
print("Book Details are Updated Successfully")
(a) Complete the Statement 1 by writing the name of library/Package
need to import for database.
(b) Complete the Statement 2 to form the cursor object.
(c) Complete the Statement 3 by writing the query that Increase the Price
of the Books by 10% whose Price is more than 300.
(d) Complete the Statement 4 to execute the command that update the
records in the table Books.
Q3. Practical Record (Report File) [7]
Q4. Project file [8]
Q5. Viva Voce [3]

Internal Examiner External Examiner


[Mr/Mrs.________] [Mr/Mrs.__________________]
[EXTERNAL NUMBER: _________]
AISSCE COMPUTER SCIENCE
SET D
PRACTICAL EXAMINATION 2022-2023

School Code :
School Name :
Class : XII
Subject Code : 083
Subject : COMPUTER SCIENCE (NEW)
Reg.No : ___________________________
Date & Day :
Max.Marks : 30
Time : 3:00 HRS
Q.No Description Marks

PART – I (Python Program)


Q1. Write a Menu Driven Program to perform the following:
[8]
(i) To read contents from a text file "ABC.TXT" that counts the number of
"He" or "She" words present in a text file.
(ii) To read the contents from text file "MyNotes.txt" and display those
lines which start with the letter "M" or "A".

PART - II (Python Connectivity)


Q2. Complete the following Database connectivity program by writing missing [4]
statements and perform the given query.
TABLE: TRAINER
Tid TName City DOJ
101 Sunaina Delhi 1998-10-15
102 Anu Chennai 1994-12-24
103 Raja Mumbai 2001-11-05
104 Ganesh Chennai 2006-05-09
105 Meenakshi Madurai 2019-05-06

The code given below inserts the following record in the table Trainer.
TId - integer, TName- string , City – String, DOJ - Date
Note the following to establish connectivity between Python and MYSQL:

➢ Username: root
➢ Password: root
➢ The table exists in a MYSQL data base named "Company".
➢ The details (Tid, TName, City, DOJ) are to be accepted from the
user.

import ___________________ as sql # Statement 1


mycon=sql.connect(host="localhost",user="root", password="root",
database="Company")
cur=______________________ # Statement 2
Query=______________________ # Statement 3
cur.execute(Query)
mycon.______________ #Statement 4
print("Trainer Details are Deleted Successfully")
mycon.close()
(e) Complete the Statement 1 by writing the name of library/Package
need to import for database.
(f) Complete the Statement 2 to form the cursor object.
(g) Complete the Statement 3 by writing the query that deletes the trainer
details whose city is "Chennai".
(h) Complete the Statement 4 to - to add the record permanently in the
database.
Q3. Practical Record (Report File) [7]
Q4. Project file [8]
Q5. Viva Voce [3]

Internal Examiner External Examiner


[Mr/Mrs.________] [Mr/Mrs.__________________]
[EXTERNAL NUMBER: _________]
AISSCE COMPUTER SCIENCE
SET E
PRACTICAL EXAMINATION 2022-2023

School Code :
School Name :
Class : XII
Subject Code : 083
Subject : COMPUTER SCIENCE (NEW)
Reg.No : ___________________________
Date & Day :
Max.Marks : 30
Time : 3:00 HRS
Q.No Description Marks

PART – I (Python Program)


Q1. Write a python program to create and search employee’s record in csv file.
[8]

PART - II (Python Connectivity)


Q2. Complete the following Database connectivity program by writing missing [4]
statements and perform the given query.
TABLE: GRADUATE
Sid SName Stipend Dept
1 Arun 1200 Physics
2 Nisha 1800 CS
3 Mano 1300 Chemistry
4 Pooja 1450 Maths
5 Kumar 2500 CS

The code given below inserts the following record in the table "Graduate":
SId - integer, SName- string , Stipend – integer, Dept- string
Note the following to establish connectivity between Python and MYSQL:

➢ Username: root
➢ Password: root
➢ The table exists in a MYSQL data base named "University".
➢ The details (Sid, SName, Stipend, and Dept) are to be accepted
from the user.

import mysql.connector as sql


mycon=sql.connect(host="localhost",user="root", password="root",
database="University")
cur=______________________ # Statement 1
Query=______________________ # Statement 2
cur.____________(Query) # Statement 3
D=cur.fetchall()
print(D)
mycon.__________ #Statement 4
(a) Complete the Statement 1 to form the cursor object.
(b) Complete the Statement 2 to by writing the query that used to view
the details of the graduate whose Dept is "CS".
(c) Complete the Statement 3 to execute the Query.
(d) Complete the Statement 4 to close the connection.
Q3. Practical Record (Report File) [7]
Q4. Project file [8]
Q5. Viva Voce [3]

Internal Examiner External Examiner


[Mr/Mrs.________] [Mr/Mrs.__________________]
[EXTERNAL NUMBER: _________]
AISSCE COMPUTER SCIENCE
SET F
PRACTICAL EXAMINATION 2022-2023

School Code :
School Name :
Class : XII
Subject Code : 083
Subject : COMPUTER SCIENCE (NEW)
Reg.No : ___________________________
Date & Day :
Max.Marks : 30
Time : 3:00 HRS
Q.No Description Marks

PART – I (Python Program)


Q1. Write a Python program to implement PUSH, POP and Display operations
[8]
in Stack using List.

PART - II (Python Connectivity)


Q2. Complete the following Database connectivity program by writing missing [4]
statements and perform the given query.

The code given below inserts the following record in the table "Library":
CDNO - integer, Name- string , Qty – integer, Price – integer.
Note the following to establish connectivity between Python and MYSQL:

➢ Username: root
➢ Password: root
➢ The table exists in a MYSQL data base named "School".
➢ The details (CDNO, Name, Qty, Price) are to be accepted from the
user.

import mysql.connector as sql


mycon=_________________ # Statement 1
cur=______________________ # Statement 2
Q=______________________ # Statement 3
cur.____________(Q) # Statement 4
D=cur.fetchall()
print(D)
mycon.close()
(e) Complete the Statement 1 to create the connection object.
(f) Complete the Statement 2 to create the cursor object.
(g) Complete the Statement 3 by writing the query that used to view the
details of Library whose price is NULL and Qty is greater than 15.
(h) Complete the Statement 4 to execute the query.
Q3. Practical Record (Report File) [7]
Q4. Project file [8]
Q5. Viva Voce [3]

Internal Examiner External Examiner


[Mr/Mrs.________] [Mr/Mrs.__________________]
[EXTERNAL NUMBER: _________]

You might also like