Latest Practical Question Paper of CBSE Class 12 Computer Science 2020-21 with Solutions

Share with others

Practical Question Paper Class 12 Computer Science 2020-21

Practical Question Paper
Practical Question Paper Class 12

Practical Exam Question Paper Class 12 Computer Science 2020-21

SET – 1

AISSCE Practical Examination 2020 – 2021

COMPUTER SCIENCE – 083

Time : 3:00hrs                                                                                            M.M. – 30

Q1.A binary file “Book.dat” has structure [BookNo,  Book_Name,  Author, Price].

a) Write a user defined function CreateFile() to input data for a record and add to Book.dat .

b) Write a function CountRec(Author) in Python which accepts the Author name as parameter and

count and return number of books by the given Author are stored in the binary file “Book.dat    
7
Q2.Write a program in python to display all the records of table “student” already created in MySQL.5
Q3.Practical File7
Q4.Project File8
Q5.Viva-Voce3
Practical Question Paper Class 12 Computer Science

Internal Examiner details                             External Examiner details:

Examiner No:                                              Examiner No:

Name:                                                         Name:

Sign:                                                           Sign:

Date:                                                           Date:


SOLUTION OF PRACTICAL QUESTION PAPER SET – 1:

Ans 1

import pickle

def createfile():

   fobj=open(“Book.dat”,”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]

   pickle.dump(rec, fobj)

   fobj.close()

createfile()  # This function is called just to verify result and not required in exam

def countrec(Author):

   fobj=open(“Book.dat”, “rb”)

   num = 0

   try:

      while True:

         rec=pickle.load(fobj)

         if Author==rec[2]:

            num = num + 1

            print(rec[0],rec[1],rec[2],rec[3])

   except:

   fobj.close()

   return num

n=countrec(“amit”) # This function is called just to verify result and not required in exam

print(“Total records”, n) # This statement is just to verify result and not required in exam

Ans2.

import mysql.connector

mydb = mysql.connector.connect(host=”localhost”,   user=”root”,passwd=”Agnel@123″, database=”amit”)

mycursor = mydb.cursor()

mycursor.execute(“Select * from student;”)

for i in mycursor:   

print(i)


CLICK FOR EXPECTED PYTHON VIVA QUESTIONS


Practical Exam Question Paper Class 12 Computer Science 2020-21

SET – 2

AISSCE Practical Examination 2020 – 2021

COMPUTER SCIENCE – 083

Q1.A binary file “student.dat” has structure [admission_number, Name, percentage]. Write a program

countrec( ) in python that would read contents of file “students.dat” and display the details of


those students whose percentage is above 75. Also display number of students scoring above

75%
7
  Q2.Write a program in python to add new column “contactno” of data type Varchar (length = 10) in

“student” table already created in MySQL.
5
Q3.    Practical File7
 Q4.    Project File8
 Q5.    Viva-Voce3
Practical Question Paper

Internal Examiner details                             External Examiner details:

Examiner No:                                              Examiner No:

Name:                                                         Name:

Sign:                                                           Sign:

Date:                                                           Date:


SOLUTION OF PRACTICAL QUESTION PAPER SET – 2:

Ans 1  

import pickle
def countrec():
   fobj=open("student.dat","rb")
   num = 0
   try:
      while True:
              rec=pickle.load(fobj)
              if rec[2]>75:
                   num = num + 1
                   print(rec[0],rec[1],rec[2])
   except:
      fobj.close()
   return num 


Ans 2

 import mysql.connector

 mydb = mysql.connector.connect(host = “localhost”, user = “root”, passwd = “Agnel@123”, database = “amit”)

 mycursor = mydb.cursor( )

 mycursor.execute(“alter table student add contactno varchar(10);”) 


CLICK FOR EXPECTED PYTHON VIVA QUESTIONS


Class 12 Computer Science Sample Paper 2020-2021.

Class 12 Computer Science Sample Paper Marking Scheme

Class 12 Computer Science Test Series


Share with others

Leave a Reply

error: Content is protected !!