3
Most read
7
Most read
14
Most read
SECOND PRE-BOARD EXAMINATION 2020-21
Class- XII Computer Science (083)
Maximum Marks: 70 Time Allowed: 3 hours
General Instructions:
1. This question paper contains two parts A and B. Each part is compulsory.
2. Both Part A and Part B have choices.
3. Part-A has 2 sections:
a. Section – I is short answer questions, to be answered in one word or one line.
b. Section – II has two case studies questions. Each case study has 4 case-based
subparts. An examinee is to attempt any 4 out of the 5 subparts.
4. Part - B is Descriptive Paper.
5. Part- B has three sections
a. Section-I is short answer questions of 2 marks each in which two question
have internal options.
b. Section-II is long answer questions of 3 marks each in which two questions
have internal options.
c. Section-III is very long answer questions of 5 marks each in which one question
has internal option.
6. All programming questions are to be answered using Python Language only
PART-A
Section-I
Select the most appropriate option out of the options given for each question.
Attempt any 15 questions from question no1 to 21
1. Find the valid identifier from the following
(a) Tot$balance (b) TRUE (c) 4thdata (d) break
1
(b) TRUE
2. Given a string S = “ComPUterSciEnce”, write the output of
print(S[3:10:2])
1
'Ptrc'
3. ……………………….. is the module used for storing data in binary format. It can
be used to store any kind of object in file and allows to store python objects with
their structure..
1
PICKLE
4. Identify the valid relational operator in Python from the following. 1
1
Chinthala Vijaya Kumar
PGTCS
(a) ? (b) => (c) != (d) in
(c) !=
5. Suppose a tuple T is declared as T=(10,20,30) and a list L=["mon", "tue", "wed",
"thu", "fri", "sat", "sun"], which of the following is incorrect ?
a) min(L)
b) L[2] = 40
c) T[3] = “thurs”
d) print( min(T))
1
(c) T[3] = ‘thurs’
6. Write a statement in Python to declare a dictionary MONTH whose keys are
1,2,3,4,5,6 and values are January, February, March, April, May, June respectively.
1
MONTH={1:”January”, 2: “Febrary”, 3: “March”, 4: ”April”, 5: “May”, 6:”June”}
7. A tuple is declared as T = (“JAY”, “HARSH”, “SEEMA”, “PRAKASH”)
what will be the value of max(T)
1
SEEMA
8. Name the built-in mathematical function/method that is used to return the square
root of a number.
1
sqrt()
9. Name the protocol that is used for remote login. 1
TELNET
10. Mr. Bose has complained that somebody has taken my credit card details and used it
without my knowledge. He claimed to be a Bank official and Mr. Bose has shared
some confidential details with him due to which he had lost all his credit card
balance. Identify the type of cybercrime for these situations.
1
Fraud/Credit Card Fraud
11. In SQL, name the Operator that is used to search a value similar to a specific pattern
in a column using wildcard operators like % and _.
1
like
12. Riya has given the following SQL command to display Name of employees whose
Employee code is not available.
SELECT NAME FROM EMP WHERE EMPCODE=NULL;
Identify the error in above command and re write the command.
1
SELECT NAME FROM EMP WHERE EMPCODE IS NULL;
13. Write aggregate command in SQL to calculate the average of tuples in an attribute
of a table.
1
avg
14. Which of the following is a DML command ?
(a) DROP (b) INSERT (c) ALTER (d) CREATE
1
(b) INSERT
15. Name the transmission media best suitable for transmission in a large area i.e across
the countries.
1
Satellite
16. Identify the valid declaration of T:
T = {“Roll”:123, “Name”: “Hiya”, “Class”:12, “Subject” : ”Computer Science”}
1
2
Chinthala Vijaya Kumar
PGTCS
a. dictionary b. string c. tuple d. list
a. dictionary
17. If the following code is executed, what will be the output of the following code ?
Lt=[1,”Computer”,2,”Science”,10,”PRE”,30,”BOARD”]
print(Lt[3:])
1
['Science', 10, 'PRE', 30, 'BOARD']
18. In SQL, write the query to display the list of all databases. 1
SHOW DATABASES;
19. Write the expanded form of WiMAX. 1
Worldwide Interoperability for Microwave Access
20. Which among the following are valid table constraints?
a) Candidate Key
b) NULL
c) Distinct
d) Primary Key
1
d) Primary Key
21. Rearrange the following terms in increasing order of Bandwidth.
KHz, Hz, GHz, THz, MHz
1
Hz KHz MHz GHz THz
Section-II
Both the case study based questions are compulsory. Attempt any 4 subparts from
each question. Each question carries 1 mark.
22. A Book store is considering to maintain their inventory using SQL to store the data.
As a database administer, shashank has decided that:
● Name of database – BOOK STORE
● Name of table – BOOK
● The attribute of BOOK are as follows:
Code – alphanumeric of size 10
Bname – character of size 30
Cust_code – float
Price – numeric
Type – character of size 25
Table : BOOK
Code Bname Cust_code Price Type
F101 The priest C083 315 Fiction
L102 German easy C312 410 Literature
C103 Tarzan in the lost
world
C113 100 Comic
3
Chinthala Vijaya Kumar
PGTCS
F102 Untold story C083 215 Fiction
C102 War heroes C113 150 Comic
F103 Poison Garden C083 200 Fiction
(a) Identify the attribute best suitable to be declared as a primary key. 1
(b) Write the degree and cardinality of Table BOOK. 1
(c) Insert the following data into the attributes Code, BName, Cust_code and Price.
Code = ‘C105’ Bname = “City heroes” Cust_code= ‘C113’ and Price=75
1
(d) Rahul want to remove all the records from the table BOOK. Which command will
he use from the following:
(a) DROP TABLE BOOK;
(b) DELETE FROM BOOK;
(c) DROP DATABASE BOOK STORE;
(d) DELETE BOOKS FROM BOOK;
1
(e) Now Rahul wants to display the structure of the table BOOK, i.e, name of the
attributes and their respective data types that he has used in the table. Write the
query to display the same.
1
(a) Code
(b) Degree 5 Cardinality 6
(c) INSERT INTO BOOK (CODE,BNAME,CUST_CODE,PRICE) VALUES(‘C105’, ‘CITY
HEROES’, ‘C113’, 75);
(d) (b) DELETE FROM BOOK;
(e) desc/describe BOOK;
23 Parth Patel of class 12 is writing a program to create a CSV file “emp.csv” which will
contain employee code and name of some employees. He has written the following
code. As a programmer, help him to successfully execute the given task.
import #Line 1
def addemp(empcode,name):#to write/add data into the CSV file
fo=open('emp.csv','a')
writer=csv. (fo) #Line 2
writer.writerow([empcode,name])
fo.close()
#csv file reading code
def reademp():
with open('emp.csv',' ') as fin: #Line 3
filereader=csv.reader(fin)
for row in filereader:
for data in row:
print(data,end='t')
print(end='n')
4
Chinthala Vijaya Kumar
PGTCS
fin. #Line 4
addemp('E105','Parth')
addemp("E101",'Arunima')
addemp("E102",'Prahalad')
reademp() #Line 5
(a) Name the module he should import in Line 1. 1
(b) Fill in the blank in Line 2 to write the data in a CSV file. 1
(c) In which mode, Parth should open the file to read the data from the file(Line 3). 1
(d) Fill in the blank in Line 4 to close the file. 1
(e) Write the output he will obtain while executing Line 5. 1
(a) LINE 1 : csv
(b) LINE 2 : writer
(c) LINE 3: r
(d) LINE 4: close()
(e) E105 Parth
E101 Arunima
E102 Prahalad
PART-B
Section-I
24. Give the output given by the following code fragments.
a) y=str(123)
print(y*3)
b) 5 <10 and 10 < 5 or 3 < 18 and not 8 < 18
2
(a) 123123123
(b) False
25. Differentiate between Spam and Trojan horse in context of networking and data
communication threats.
OR
Differentiate between URL and Domain name. Explain with help of a suitable
example.
2
A Trojan horse is a program that contains hidden malicious functions. Trojan Horses trick
users into installing them by appearing to be legitimate programs. Once installed on a
system, they reveal their true nature and cause damage.
The term spam means endless repetition of worthless text. In other words, unwanted
messages or mails are known as Spam. Most spam is commercial advertising. In addition to
wasting people's time, spam also eats up a lot of network bandwidth.
OR
Web address of the web page written on the address bar of the browser is known as the
uniform resource locator (URL). A URL is a formatted text string used to identify a network
resource on the Internet.
The host name or address substring identifies the host/server that holds the resource. Hosts
names are sometimes called domain names. For example: www. gvkcv.in is a domain name
and URL is http://www.gvkcv.in is URL.
26 Expand the following terms:
a. FTP b. HTML c. PAN d. GPRS
2
5
Chinthala Vijaya Kumar
PGTCS
a) FTP – File Transfer Protocol
b) HTML – Hyper Text Transfer Protocol
c) PAN – Personal Area Network
d) GPRS - General packet radio service
27. Write the output given by following Python code.
x=1
def fun1():
x=3
x=x+1
print(x)
def fun2():
global x
x=x+2
print(x)
fun1()
fun2()
OR
What do you mean by default parameters? Explain with the help of suitable
example.
2
4
3
OR
Default values indicate that the function argument will take that value if no
argument value is passed during the function call. The default value is assigned by
using the assignment(=) operator of the form keywordname=value.
Example:
def student(firstname, lastname ='Mark', standard ='Fifth'):
print(firstname, lastname, 'studies in', standard, 'Standard')
# 1 positional argument
student('John')
# 3 positional arguments
student('John', 'Gates', 'Seventh')
# 2 positional arguments
student('John', 'Gates')
student('John', 'Seventh')
Output:
John Mark studies in Fifth Standard
John Mark studies in Seventh Standard
6
Chinthala Vijaya Kumar
PGTCS
John Gates studies in Fifth Standard
28. Rewrite the following code in Python after removing all syntax error(s). Underline
each correction done in the code.
STRING=""WELCOME
NOTE = " "
for S in range(0,8):
if STRING[S]= ’E’:
print(STRING(S))
Else:
print “NO”
2
STRING="WELCOME”
NOTE = " "
for S in range(0,8):
if STRING[S]== ’E’:
print(STRING(S))
else:
print (“NO”)
29. What are the possible outcome(s) executed from the following code ? Also specify
the maximum and minimum values that can be assigned to variable N.
import random
SIDES=["EAST","WEST","NORTH","SOUTH"]
N=random.randint(1,3)
OUT=""
for I in range(N,1,–1):
OUT=OUT+SIDES[I]
print(OUT)
(i) SOUTHNORTH
(ii) SOUTHNORTHWEST
(iii) SOUTH
(iv) EASTWESTNORTH
2
Maximum value for N is 3
Minimum value for N is 1
(ii) SOUTHNORTHWEST
30 What do you understand by Primary key and Candidate keys in a table ? Explain with
the help of suitable example from a table containing some meaningful data.
2
Candidate key: A candidate key is one that can identify each row of a table uniquely.
Generally, a candidate key becomes the primary key of the table. If the table has
more than one candidate key, one of them will become the primary key, and the rest
are called alternate keys.
7
Chinthala Vijaya Kumar
PGTCS
In the above table Rollno and Reg# can be candidate keys. There can be more than
one candidate key out of which one can be chosen as primary key(Rollno).
31. #To fetch all records of a table at run time
import .connector #Line 1
mydb=mysql.connector. (host="localhost",user="root",
passwd="root", database="school") #Line 2
mycursor=mydb.cursor()
mycursor. ("select * from student") # Line 3
myrecords=mycursor. () # Line 4
for x in myrecords:
print (x)
2
Line1: mysql
Line 2: connect
Line 3: execute
Line 4: fetchall
32. How INSERT is different from ALTER command in SQL. 2
INSERT is a DML Command to insert rows in a Table. Example: INSERT INTO BOOK
(CODE,BNAME,CUST_CODE,PRICE) VALUES(‘C105’, ‘CITY HEROES’, ‘C113’, 75);
ALTER is a DDL command to ADD, REMOVE or CHANGE column/s in a Table.
Example: ALTER TABLE BOOK ADD (TYPE VARCHAR(20));
33. Find and write the output of the following Python code :
Str1="PREBOARD2020"
Str2=""
I=0
while I<len(Str1):
if Str1[I]>="A" and Str1[I]<="R":
Str2=Str2+Str1[I+1]
elif Str1[I]>="0" and Str1[I]<="9":
Str2=Str2+ (Str1[I-1])
else:
Str2=Str2+"*"
I=I+1
2
8
Chinthala Vijaya Kumar
PGTCS
print(Str2)
REBOARD2D202
Section-II
34. Write definition of a method ODDSum(NUMBERS) to add those values in the list of
NUMBERS, which are odd.
Sample Input Data of the List
NUMBERS=[20,40,10,5,12,11]
OUTPUT is 16
3
def ODDSum(NUMBERS):
s=0
for i in NUMBERS:
if i%2 !=0:
s=s+i
print(s)
Using any correct code giving the same result is also accepted
35. Write a method cnt_M() in Python to read lines from a text file ‘MYNOTES.TXT’, and
display those lines, which are starting with the alphabet ‘M’‖.
If the “MYNOTES.TXT” contents are as follows:
My first book was
Me and My Family.
It gave me chance to be
Known to the world.
The output of the function should be:
Count of lines starting with M is: 2
OR
Write a method/function LARGEWORDS() in Python to read contents from a text file
CODE.TXT, to count and display the occurrence of those words, which are having 7
or more alphabets.
For example :
If the content of the file is
ME AND MY FRIENDS
ENSURE SAFETY AND SECURITY OF
EVERYONE
The output of the function should be: 3
3
def cnt_M():
num=0
f=open('MYNOTES.TXT','r')
for line in f.readlines():
if line[0]=='M':
num=num+1
print(num)
f.close()
OR
def LARGEWORDS():
9
Chinthala Vijaya Kumar
PGTCS
num=0
f=open('CODE.TXT','r')
data=f.read()
words=data.split()
for w in words:
if len(w)>=7:
num=num+1
print(num)
f.close()
Using any correct code giving the same result is also accepted
36. Write the outputs of the SQL queries (i) to (iii) based on relations EMP and DESIG
given below:
Table: EMP
E_ID Name Gender Age DOJ Designation
1 Om Prakash M 35 10/11/2009 Manager
2 Jai Kishan M 32 12/05/2013 Accountant
3 Shreya Sharma F 30 05/02/2015 Clerk
4 Rakesh Minhas M 40 15/05/2007 Manager
5 Himani Singh F 33 19/09/2010 Clerk
Table: DESIG
Salary E_ID DEPT_ID
45000 1 D101
35000 2 D102
45000 4 D101
i) SELECT Designation, count(*) FROM EMP GROUP BY Designation;
ii) SELECT AVG(Age) FROM EMP;
iii) SELECT EMP.Name, EMP.Designation,DESIG.Salary FROM EMP, DESIG WHERE
EMP.E_ID = DESIG.E_ID AND EMP.Age>35;
3
OUTPUT:
(i)
Designation Count(*)
Manager 2
Accountant 1
Clerk 2
(ii) AVG(Age)
34
(iii)
10
Chinthala Vijaya Kumar
PGTCS
37. Write a function in Python PUSH(Num), where Num is a list of integer numbers.
From this list push all positive even numbers into a stack implemented by using a
list. Display the stack if it has at least one element, otherwise display appropriate
error message.
OR
Write a function in Python POP(cities), where cities is a stack implemented by a list
of city names for eg. cities=[‘Delhi’, ’Jaipur’, ‘Mumbai’, ‘Nagpur’]. The function
returns the value deleted from the stack.
3
Using any correct code giving the same result is also accepted
def PUSH(Num):
s=[]
for x in Num:
if x%2==0 and x>0:
s.append(x)
if len(s)==0:
print("STACK EMPTY")
else:
print(s)
OR
def POP(cities):
#For empty stack
if(len(cities)==0):
print("Under flow")
else:
l=len(cities)
c=cities[l-1]
print(c)
cities.pop(l-1)
Section-III
38. Biyani Design and Training Institute is setting up its center in Jaipur with four
specialized units for Design, Media, HR and Training in separate buildings. The
physical distances between these units and the number of computers to be installed
in these units are given as follows.
You as a network expert, have to answer the queries as raised by the administrator
as given in (i) to (v).
Shortest distances between various locations in meters :
Design Unit to Media Unit 60
Design Unit to HR Unit 40
Design Unit to Training Unit 60
Media Unit to Training Unit 100
Media Unit to HR Unit 50
Training Unit to HR Unit 60
5
11
Chinthala Vijaya Kumar
PGTCS
Number of computers installed at various locations are as follows:
Design Unit 40
Media Unit 50
HR Unit 110
Training Unit 40
HR
DESIGN
TRAINING
MEDIA
a)Suggest the most suitable place (i.e.,Unit/Building) to install the server of this
Institute.
b) Suggest an ideal layout for connecting these Unit/Building for a wired
connectivity.
c) Suggest the devices to be installed in each of these buildings for connecting
computers installed within each of the units out of the following :
Modem, Switch, Gateway, Router
d) Suggest an efficient as well as economic wired medium to be used within each
unit for connecting computer systems out of the following network cable :
Co-axial Cable, Ethernet Cable, Single Pair Telephone Cable.
e) The institute is planning to connect its admission office in Bangalore, which is
1960km from institute. Which type of network out of LAN, MAN or WAN will be
formed ? Justify your answer.
a. Most suitable place to install the server is HR Unit
b. Bus/Star topology
c. Switch
d. Ethernet Cable
39. Consider the following tables WORKERS and DESIG. Write SQL commands for the
statements (i) to (iv) and give outputs for SQL queries (v) to (viii) :
5
12
Chinthala Vijaya Kumar
PGTCS
WORKERS
W_ID FIRSTNAME LASTNAME GENDER ADDRESS CITY
102 Sam Tones M 33 Elm St Paris
105 Sarah Ackerman F U.S. 110 New York
144 Manila Sengupta F 24 Friends Street New Delhi
210 George Smith M 83 First Street Howard
255 Mary Jones F 842,Vine Ave. Losantiville
300 Robert Samuel M 9 Fifth Cross Washington
335 Henry Williams M 12 Moore Street Boston
403 Ronny Lee M 121 Harrison St. New York
451 Pat Thompson M 11 Red Road Paris
DESIG
W_ID SALARY BENEFITS DESIGNATION
102 75000 15000 Manager
105 85000 25000 Director
144 70000 15000 Manager
210 75000 12500 Manager
255 50000 12000 Clerk
300 45000 10000 Clerk
335 40000 10000 Clerk
400 32000 7500 Salesman
451 28000 7500 Salesman
(i) To display W_ID, Firstname, Address and City of all employees living in New York
from the table WORKERS.
(ii) To display the content of WORKERS table in ascending order of LASTNAME.
(iii) To display First Name, Worker ID and Address of male Workers only.
(iv) To display the Minimum salary among Managers and Clerks from the table DESIG.
(v) To display First Name and Salary from Workers and Desig Table for each worker.
(i) SELECT W_ID,FIRSTNAME, ADDRESS, CITY FROM WORKERS WHERE CITY=’New
York’;
(ii) SELECT * FROM WORKERS ORDER BY LASTNAME;
(iii) SELECT FIRSTNAME, W_ID, ADDRESS FROM WORKERS WHERE GENDER=’M’;
(iv) SELECT MIN(SALARY) FROM DESIG WHERE DESIGNATION IN(‘MANAGER’,
‘CLERKS’);
(v) SELECT FIRSTNAME, SALARY FROM WORKERS, DESIG WHERE
WORKERS.W_ID=DESIG.W_ID;
40. A binary file “STOCK.DAT” has structure [ITEMID, ITEMNAME, QUANTITY, PRICE].
(i) Write a user defined function MakeFile( ) to input data for a record and add to
Book.dat.
(ii) Write a function GetPrice(ITEMID) in Python which accepts the ITEMID as
parameter and return PRICE of the Item stored in Binary file STOCK.DAT.
OR
5
13
Chinthala Vijaya Kumar
PGTCS
A binary file “EMPLOYEE.DAT” has structure (EMPID, EMPNAME, SALARY). Write a function
CountRec( ) in Python that would read contents of the file “EMPLOYEE.DAT” and display the
details of those Employees whose Salary is above 20000. Also display number of employees
having Salary more than 20000.
(i)import pickle
def MakeFile():
fobj=open("STOCK.DAT",'ab')
itemid=input("Enter ITEM ID")
itemname=input("Enter name of the Item")
Q=int(input("Enter the quantity of Item"))
price=float(input("Enter the price"))
rec=[itemid,itemname,Q,price]
pickle.dump(rec,fobj)
fobj.close()
(ii)
def GetPrice(ITEMID):
fobj=open("STOCK.DAT",'rb')
try:
while True:
rec=pickle.load(fobj)
if(rec[0]in str(ITEMID)):
print("Price of ", rec[0], "item is",rec[3])
return rec[0]
except:
fobj.close()
OR
import pickle
def CountRec():
fobj=open("EMPLOYEE",'rb')
num=0
try:
while True:
rec=pickle.load(fobj)
if(rec[2]>20000):
print(rec[0],rec[1],rec[2])
num=num+1
except:
fobj.close()
return num
Using any correct code giving the same result is also accepted
14
Chinthala Vijaya Kumar
PGTCS

More Related Content

PDF
Determination of Caffeine In Tea Samples
PDF
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12
PDF
CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21
DOCX
Physics investigatory project for class 12
DOCX
Chemistry investigatory project class 12 th by nohar das tandon
DOCX
Ip library management project
PDF
Physical education class 12 (sachin kasana)
PDF
Chemistry Investigatory Project on COLD DRINKS
Determination of Caffeine In Tea Samples
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12
CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21
Physics investigatory project for class 12
Chemistry investigatory project class 12 th by nohar das tandon
Ip library management project
Physical education class 12 (sachin kasana)
Chemistry Investigatory Project on COLD DRINKS

What's hot (20)

PDF
toaz.info-chemistry-project-essential-oils-12-pr_44c692d978be5f0e9bfe6a36473f...
PDF
Various factors on which the internal resistance of a cell depends
ODT
PREPARATION OF SOYBEAN MILK AND ITS COMPARISION WITH NATURAL MILK
DOCX
computer science with python project for class 12 cbse
PDF
Business Studies Class 12th Marketing management Project- Fruit Juice
DOCX
Chemistry investigatory HARDNESS OF WATER
PPTX
The Tiger King
PDF
Employee Management (CS Project for 12th CBSE)
DOCX
Sterlization of water using bleaching powder
PDF
Computer Project for class 12 CBSE on school management
DOCX
chemistry project on preparation of potash alum
PDF
A study of oxalate ion in guava
PDF
Class 12 Biology Investigatory Project CBSE
DOCX
Class 12 Chemistry Investigatory Project Work, Practical- Determination of Ca...
PDF
Monetary Policy committee_Project work class 12
PDF
Factors on which the internal resistance/emf of a cell depends
DOCX
DOCX
PPTX
Lost spring
PDF
On the face of it English project for class 12 students
toaz.info-chemistry-project-essential-oils-12-pr_44c692d978be5f0e9bfe6a36473f...
Various factors on which the internal resistance of a cell depends
PREPARATION OF SOYBEAN MILK AND ITS COMPARISION WITH NATURAL MILK
computer science with python project for class 12 cbse
Business Studies Class 12th Marketing management Project- Fruit Juice
Chemistry investigatory HARDNESS OF WATER
The Tiger King
Employee Management (CS Project for 12th CBSE)
Sterlization of water using bleaching powder
Computer Project for class 12 CBSE on school management
chemistry project on preparation of potash alum
A study of oxalate ion in guava
Class 12 Biology Investigatory Project CBSE
Class 12 Chemistry Investigatory Project Work, Practical- Determination of Ca...
Monetary Policy committee_Project work class 12
Factors on which the internal resistance/emf of a cell depends
Lost spring
On the face of it English project for class 12 students
Ad

Similar to GVKCV Computer Science(083) Pre board sample paper 2 Class 12 (20-21) with solutions (20)

PDF
selfstudys_com_file (4).pdfjsjdcjjsjxjdnxjj
PDF
Class 12 computer sample paper with answers
PDF
Sample Questions for XII Computer Science (2).pdf
DOCX
information practices cbse based paper.docx
PDF
ComputerScience-SQP.pdffhtu h kya hua hai ap ka school
PDF
Computer science sqp
PDF
2023 9b09kvuofjfouijfd8bifjbuiofjdfoivbjdogbj
PDF
CS_PQMS.pdf
PDF
Question Paper Code 065 informatic Practice New CBSE - 2021
DOCX
Sample-Program-file-with-output-and-index.docx
PPT
Python Unit I MCQ.ppt
DOCX
sample practical file 2022-23 aniket choudhary.docx
PDF
GE3151 UNIT II Study material .pdf
PDF
InformaticsPractices-MS - Google Docs.pdf
PDF
Python-Institute.realtests.PCAP.v20q.pdf
PDF
XII CS QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SET-II.pdf
PDF
class 12 computer science pdf of class e
PPTX
Unit 1- Python- Features, Variables, Data Types, Operators and Expressions
PDF
90 Informatics Practices.pdf
DOCX
SS3 DATA PROCESSING EXAMINATION (FIRST TERM)
selfstudys_com_file (4).pdfjsjdcjjsjxjdnxjj
Class 12 computer sample paper with answers
Sample Questions for XII Computer Science (2).pdf
information practices cbse based paper.docx
ComputerScience-SQP.pdffhtu h kya hua hai ap ka school
Computer science sqp
2023 9b09kvuofjfouijfd8bifjbuiofjdfoivbjdogbj
CS_PQMS.pdf
Question Paper Code 065 informatic Practice New CBSE - 2021
Sample-Program-file-with-output-and-index.docx
Python Unit I MCQ.ppt
sample practical file 2022-23 aniket choudhary.docx
GE3151 UNIT II Study material .pdf
InformaticsPractices-MS - Google Docs.pdf
Python-Institute.realtests.PCAP.v20q.pdf
XII CS QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SET-II.pdf
class 12 computer science pdf of class e
Unit 1- Python- Features, Variables, Data Types, Operators and Expressions
90 Informatics Practices.pdf
SS3 DATA PROCESSING EXAMINATION (FIRST TERM)
Ad

More from chinthala Vijaya Kumar (9)

PDF
Inserting an element in a sorted array using traditional algorithm
PDF
Binary search in Python using recursion
PDF
Linear search python CBSE Class 12
PDF
Data visualization pyplot
PDF
Data handling CBSE PYTHON CLASS 11
PDF
PDF
Python Fundamentals Class 11
PDF
File handling CBSE CLASS 12
PDF
Recursion CBSE Class 12
Inserting an element in a sorted array using traditional algorithm
Binary search in Python using recursion
Linear search python CBSE Class 12
Data visualization pyplot
Data handling CBSE PYTHON CLASS 11
Python Fundamentals Class 11
File handling CBSE CLASS 12
Recursion CBSE Class 12

Recently uploaded (20)

PDF
What if we spent less time fighting change, and more time building what’s rig...
PPTX
TNA_Presentation-1-Final(SAVE)) (1).pptx
PDF
HVAC Specification 2024 according to central public works department
PDF
AI-driven educational solutions for real-life interventions in the Philippine...
PPTX
Share_Module_2_Power_conflict_and_negotiation.pptx
PDF
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
PPTX
Introduction to pro and eukaryotes and differences.pptx
PDF
Uderstanding digital marketing and marketing stratergie for engaging the digi...
PDF
Empowerment Technology for Senior High School Guide
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
My India Quiz Book_20210205121199924.pdf
PDF
FORM 1 BIOLOGY MIND MAPS and their schemes
PPTX
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
PPTX
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
PDF
Weekly quiz Compilation Jan -July 25.pdf
PPTX
History, Philosophy and sociology of education (1).pptx
DOCX
Cambridge-Practice-Tests-for-IELTS-12.docx
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
What if we spent less time fighting change, and more time building what’s rig...
TNA_Presentation-1-Final(SAVE)) (1).pptx
HVAC Specification 2024 according to central public works department
AI-driven educational solutions for real-life interventions in the Philippine...
Share_Module_2_Power_conflict_and_negotiation.pptx
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
Introduction to pro and eukaryotes and differences.pptx
Uderstanding digital marketing and marketing stratergie for engaging the digi...
Empowerment Technology for Senior High School Guide
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
My India Quiz Book_20210205121199924.pdf
FORM 1 BIOLOGY MIND MAPS and their schemes
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
Weekly quiz Compilation Jan -July 25.pdf
History, Philosophy and sociology of education (1).pptx
Cambridge-Practice-Tests-for-IELTS-12.docx
Practical Manual AGRO-233 Principles and Practices of Natural Farming

GVKCV Computer Science(083) Pre board sample paper 2 Class 12 (20-21) with solutions

  • 1. SECOND PRE-BOARD EXAMINATION 2020-21 Class- XII Computer Science (083) Maximum Marks: 70 Time Allowed: 3 hours General Instructions: 1. This question paper contains two parts A and B. Each part is compulsory. 2. Both Part A and Part B have choices. 3. Part-A has 2 sections: a. Section – I is short answer questions, to be answered in one word or one line. b. Section – II has two case studies questions. Each case study has 4 case-based subparts. An examinee is to attempt any 4 out of the 5 subparts. 4. Part - B is Descriptive Paper. 5. Part- B has three sections a. Section-I is short answer questions of 2 marks each in which two question have internal options. b. Section-II is long answer questions of 3 marks each in which two questions have internal options. c. Section-III is very long answer questions of 5 marks each in which one question has internal option. 6. All programming questions are to be answered using Python Language only PART-A Section-I Select the most appropriate option out of the options given for each question. Attempt any 15 questions from question no1 to 21 1. Find the valid identifier from the following (a) Tot$balance (b) TRUE (c) 4thdata (d) break 1 (b) TRUE 2. Given a string S = “ComPUterSciEnce”, write the output of print(S[3:10:2]) 1 'Ptrc' 3. ……………………….. is the module used for storing data in binary format. It can be used to store any kind of object in file and allows to store python objects with their structure.. 1 PICKLE 4. Identify the valid relational operator in Python from the following. 1 1 Chinthala Vijaya Kumar PGTCS
  • 2. (a) ? (b) => (c) != (d) in (c) != 5. Suppose a tuple T is declared as T=(10,20,30) and a list L=["mon", "tue", "wed", "thu", "fri", "sat", "sun"], which of the following is incorrect ? a) min(L) b) L[2] = 40 c) T[3] = “thurs” d) print( min(T)) 1 (c) T[3] = ‘thurs’ 6. Write a statement in Python to declare a dictionary MONTH whose keys are 1,2,3,4,5,6 and values are January, February, March, April, May, June respectively. 1 MONTH={1:”January”, 2: “Febrary”, 3: “March”, 4: ”April”, 5: “May”, 6:”June”} 7. A tuple is declared as T = (“JAY”, “HARSH”, “SEEMA”, “PRAKASH”) what will be the value of max(T) 1 SEEMA 8. Name the built-in mathematical function/method that is used to return the square root of a number. 1 sqrt() 9. Name the protocol that is used for remote login. 1 TELNET 10. Mr. Bose has complained that somebody has taken my credit card details and used it without my knowledge. He claimed to be a Bank official and Mr. Bose has shared some confidential details with him due to which he had lost all his credit card balance. Identify the type of cybercrime for these situations. 1 Fraud/Credit Card Fraud 11. In SQL, name the Operator that is used to search a value similar to a specific pattern in a column using wildcard operators like % and _. 1 like 12. Riya has given the following SQL command to display Name of employees whose Employee code is not available. SELECT NAME FROM EMP WHERE EMPCODE=NULL; Identify the error in above command and re write the command. 1 SELECT NAME FROM EMP WHERE EMPCODE IS NULL; 13. Write aggregate command in SQL to calculate the average of tuples in an attribute of a table. 1 avg 14. Which of the following is a DML command ? (a) DROP (b) INSERT (c) ALTER (d) CREATE 1 (b) INSERT 15. Name the transmission media best suitable for transmission in a large area i.e across the countries. 1 Satellite 16. Identify the valid declaration of T: T = {“Roll”:123, “Name”: “Hiya”, “Class”:12, “Subject” : ”Computer Science”} 1 2 Chinthala Vijaya Kumar PGTCS
  • 3. a. dictionary b. string c. tuple d. list a. dictionary 17. If the following code is executed, what will be the output of the following code ? Lt=[1,”Computer”,2,”Science”,10,”PRE”,30,”BOARD”] print(Lt[3:]) 1 ['Science', 10, 'PRE', 30, 'BOARD'] 18. In SQL, write the query to display the list of all databases. 1 SHOW DATABASES; 19. Write the expanded form of WiMAX. 1 Worldwide Interoperability for Microwave Access 20. Which among the following are valid table constraints? a) Candidate Key b) NULL c) Distinct d) Primary Key 1 d) Primary Key 21. Rearrange the following terms in increasing order of Bandwidth. KHz, Hz, GHz, THz, MHz 1 Hz KHz MHz GHz THz Section-II Both the case study based questions are compulsory. Attempt any 4 subparts from each question. Each question carries 1 mark. 22. A Book store is considering to maintain their inventory using SQL to store the data. As a database administer, shashank has decided that: ● Name of database – BOOK STORE ● Name of table – BOOK ● The attribute of BOOK are as follows: Code – alphanumeric of size 10 Bname – character of size 30 Cust_code – float Price – numeric Type – character of size 25 Table : BOOK Code Bname Cust_code Price Type F101 The priest C083 315 Fiction L102 German easy C312 410 Literature C103 Tarzan in the lost world C113 100 Comic 3 Chinthala Vijaya Kumar PGTCS
  • 4. F102 Untold story C083 215 Fiction C102 War heroes C113 150 Comic F103 Poison Garden C083 200 Fiction (a) Identify the attribute best suitable to be declared as a primary key. 1 (b) Write the degree and cardinality of Table BOOK. 1 (c) Insert the following data into the attributes Code, BName, Cust_code and Price. Code = ‘C105’ Bname = “City heroes” Cust_code= ‘C113’ and Price=75 1 (d) Rahul want to remove all the records from the table BOOK. Which command will he use from the following: (a) DROP TABLE BOOK; (b) DELETE FROM BOOK; (c) DROP DATABASE BOOK STORE; (d) DELETE BOOKS FROM BOOK; 1 (e) Now Rahul wants to display the structure of the table BOOK, i.e, name of the attributes and their respective data types that he has used in the table. Write the query to display the same. 1 (a) Code (b) Degree 5 Cardinality 6 (c) INSERT INTO BOOK (CODE,BNAME,CUST_CODE,PRICE) VALUES(‘C105’, ‘CITY HEROES’, ‘C113’, 75); (d) (b) DELETE FROM BOOK; (e) desc/describe BOOK; 23 Parth Patel of class 12 is writing a program to create a CSV file “emp.csv” which will contain employee code and name of some employees. He has written the following code. As a programmer, help him to successfully execute the given task. import #Line 1 def addemp(empcode,name):#to write/add data into the CSV file fo=open('emp.csv','a') writer=csv. (fo) #Line 2 writer.writerow([empcode,name]) fo.close() #csv file reading code def reademp(): with open('emp.csv',' ') as fin: #Line 3 filereader=csv.reader(fin) for row in filereader: for data in row: print(data,end='t') print(end='n') 4 Chinthala Vijaya Kumar PGTCS
  • 5. fin. #Line 4 addemp('E105','Parth') addemp("E101",'Arunima') addemp("E102",'Prahalad') reademp() #Line 5 (a) Name the module he should import in Line 1. 1 (b) Fill in the blank in Line 2 to write the data in a CSV file. 1 (c) In which mode, Parth should open the file to read the data from the file(Line 3). 1 (d) Fill in the blank in Line 4 to close the file. 1 (e) Write the output he will obtain while executing Line 5. 1 (a) LINE 1 : csv (b) LINE 2 : writer (c) LINE 3: r (d) LINE 4: close() (e) E105 Parth E101 Arunima E102 Prahalad PART-B Section-I 24. Give the output given by the following code fragments. a) y=str(123) print(y*3) b) 5 <10 and 10 < 5 or 3 < 18 and not 8 < 18 2 (a) 123123123 (b) False 25. Differentiate between Spam and Trojan horse in context of networking and data communication threats. OR Differentiate between URL and Domain name. Explain with help of a suitable example. 2 A Trojan horse is a program that contains hidden malicious functions. Trojan Horses trick users into installing them by appearing to be legitimate programs. Once installed on a system, they reveal their true nature and cause damage. The term spam means endless repetition of worthless text. In other words, unwanted messages or mails are known as Spam. Most spam is commercial advertising. In addition to wasting people's time, spam also eats up a lot of network bandwidth. OR Web address of the web page written on the address bar of the browser is known as the uniform resource locator (URL). A URL is a formatted text string used to identify a network resource on the Internet. The host name or address substring identifies the host/server that holds the resource. Hosts names are sometimes called domain names. For example: www. gvkcv.in is a domain name and URL is http://www.gvkcv.in is URL. 26 Expand the following terms: a. FTP b. HTML c. PAN d. GPRS 2 5 Chinthala Vijaya Kumar PGTCS
  • 6. a) FTP – File Transfer Protocol b) HTML – Hyper Text Transfer Protocol c) PAN – Personal Area Network d) GPRS - General packet radio service 27. Write the output given by following Python code. x=1 def fun1(): x=3 x=x+1 print(x) def fun2(): global x x=x+2 print(x) fun1() fun2() OR What do you mean by default parameters? Explain with the help of suitable example. 2 4 3 OR Default values indicate that the function argument will take that value if no argument value is passed during the function call. The default value is assigned by using the assignment(=) operator of the form keywordname=value. Example: def student(firstname, lastname ='Mark', standard ='Fifth'): print(firstname, lastname, 'studies in', standard, 'Standard') # 1 positional argument student('John') # 3 positional arguments student('John', 'Gates', 'Seventh') # 2 positional arguments student('John', 'Gates') student('John', 'Seventh') Output: John Mark studies in Fifth Standard John Mark studies in Seventh Standard 6 Chinthala Vijaya Kumar PGTCS
  • 7. John Gates studies in Fifth Standard 28. Rewrite the following code in Python after removing all syntax error(s). Underline each correction done in the code. STRING=""WELCOME NOTE = " " for S in range(0,8): if STRING[S]= ’E’: print(STRING(S)) Else: print “NO” 2 STRING="WELCOME” NOTE = " " for S in range(0,8): if STRING[S]== ’E’: print(STRING(S)) else: print (“NO”) 29. What are the possible outcome(s) executed from the following code ? Also specify the maximum and minimum values that can be assigned to variable N. import random SIDES=["EAST","WEST","NORTH","SOUTH"] N=random.randint(1,3) OUT="" for I in range(N,1,–1): OUT=OUT+SIDES[I] print(OUT) (i) SOUTHNORTH (ii) SOUTHNORTHWEST (iii) SOUTH (iv) EASTWESTNORTH 2 Maximum value for N is 3 Minimum value for N is 1 (ii) SOUTHNORTHWEST 30 What do you understand by Primary key and Candidate keys in a table ? Explain with the help of suitable example from a table containing some meaningful data. 2 Candidate key: A candidate key is one that can identify each row of a table uniquely. Generally, a candidate key becomes the primary key of the table. If the table has more than one candidate key, one of them will become the primary key, and the rest are called alternate keys. 7 Chinthala Vijaya Kumar PGTCS
  • 8. In the above table Rollno and Reg# can be candidate keys. There can be more than one candidate key out of which one can be chosen as primary key(Rollno). 31. #To fetch all records of a table at run time import .connector #Line 1 mydb=mysql.connector. (host="localhost",user="root", passwd="root", database="school") #Line 2 mycursor=mydb.cursor() mycursor. ("select * from student") # Line 3 myrecords=mycursor. () # Line 4 for x in myrecords: print (x) 2 Line1: mysql Line 2: connect Line 3: execute Line 4: fetchall 32. How INSERT is different from ALTER command in SQL. 2 INSERT is a DML Command to insert rows in a Table. Example: INSERT INTO BOOK (CODE,BNAME,CUST_CODE,PRICE) VALUES(‘C105’, ‘CITY HEROES’, ‘C113’, 75); ALTER is a DDL command to ADD, REMOVE or CHANGE column/s in a Table. Example: ALTER TABLE BOOK ADD (TYPE VARCHAR(20)); 33. Find and write the output of the following Python code : Str1="PREBOARD2020" Str2="" I=0 while I<len(Str1): if Str1[I]>="A" and Str1[I]<="R": Str2=Str2+Str1[I+1] elif Str1[I]>="0" and Str1[I]<="9": Str2=Str2+ (Str1[I-1]) else: Str2=Str2+"*" I=I+1 2 8 Chinthala Vijaya Kumar PGTCS
  • 9. print(Str2) REBOARD2D202 Section-II 34. Write definition of a method ODDSum(NUMBERS) to add those values in the list of NUMBERS, which are odd. Sample Input Data of the List NUMBERS=[20,40,10,5,12,11] OUTPUT is 16 3 def ODDSum(NUMBERS): s=0 for i in NUMBERS: if i%2 !=0: s=s+i print(s) Using any correct code giving the same result is also accepted 35. Write a method cnt_M() in Python to read lines from a text file ‘MYNOTES.TXT’, and display those lines, which are starting with the alphabet ‘M’‖. If the “MYNOTES.TXT” contents are as follows: My first book was Me and My Family. It gave me chance to be Known to the world. The output of the function should be: Count of lines starting with M is: 2 OR Write a method/function LARGEWORDS() in Python to read contents from a text file CODE.TXT, to count and display the occurrence of those words, which are having 7 or more alphabets. For example : If the content of the file is ME AND MY FRIENDS ENSURE SAFETY AND SECURITY OF EVERYONE The output of the function should be: 3 3 def cnt_M(): num=0 f=open('MYNOTES.TXT','r') for line in f.readlines(): if line[0]=='M': num=num+1 print(num) f.close() OR def LARGEWORDS(): 9 Chinthala Vijaya Kumar PGTCS
  • 10. num=0 f=open('CODE.TXT','r') data=f.read() words=data.split() for w in words: if len(w)>=7: num=num+1 print(num) f.close() Using any correct code giving the same result is also accepted 36. Write the outputs of the SQL queries (i) to (iii) based on relations EMP and DESIG given below: Table: EMP E_ID Name Gender Age DOJ Designation 1 Om Prakash M 35 10/11/2009 Manager 2 Jai Kishan M 32 12/05/2013 Accountant 3 Shreya Sharma F 30 05/02/2015 Clerk 4 Rakesh Minhas M 40 15/05/2007 Manager 5 Himani Singh F 33 19/09/2010 Clerk Table: DESIG Salary E_ID DEPT_ID 45000 1 D101 35000 2 D102 45000 4 D101 i) SELECT Designation, count(*) FROM EMP GROUP BY Designation; ii) SELECT AVG(Age) FROM EMP; iii) SELECT EMP.Name, EMP.Designation,DESIG.Salary FROM EMP, DESIG WHERE EMP.E_ID = DESIG.E_ID AND EMP.Age>35; 3 OUTPUT: (i) Designation Count(*) Manager 2 Accountant 1 Clerk 2 (ii) AVG(Age) 34 (iii) 10 Chinthala Vijaya Kumar PGTCS
  • 11. 37. Write a function in Python PUSH(Num), where Num is a list of integer numbers. From this list push all positive even numbers into a stack implemented by using a list. Display the stack if it has at least one element, otherwise display appropriate error message. OR Write a function in Python POP(cities), where cities is a stack implemented by a list of city names for eg. cities=[‘Delhi’, ’Jaipur’, ‘Mumbai’, ‘Nagpur’]. The function returns the value deleted from the stack. 3 Using any correct code giving the same result is also accepted def PUSH(Num): s=[] for x in Num: if x%2==0 and x>0: s.append(x) if len(s)==0: print("STACK EMPTY") else: print(s) OR def POP(cities): #For empty stack if(len(cities)==0): print("Under flow") else: l=len(cities) c=cities[l-1] print(c) cities.pop(l-1) Section-III 38. Biyani Design and Training Institute is setting up its center in Jaipur with four specialized units for Design, Media, HR and Training in separate buildings. The physical distances between these units and the number of computers to be installed in these units are given as follows. You as a network expert, have to answer the queries as raised by the administrator as given in (i) to (v). Shortest distances between various locations in meters : Design Unit to Media Unit 60 Design Unit to HR Unit 40 Design Unit to Training Unit 60 Media Unit to Training Unit 100 Media Unit to HR Unit 50 Training Unit to HR Unit 60 5 11 Chinthala Vijaya Kumar PGTCS
  • 12. Number of computers installed at various locations are as follows: Design Unit 40 Media Unit 50 HR Unit 110 Training Unit 40 HR DESIGN TRAINING MEDIA a)Suggest the most suitable place (i.e.,Unit/Building) to install the server of this Institute. b) Suggest an ideal layout for connecting these Unit/Building for a wired connectivity. c) Suggest the devices to be installed in each of these buildings for connecting computers installed within each of the units out of the following : Modem, Switch, Gateway, Router d) Suggest an efficient as well as economic wired medium to be used within each unit for connecting computer systems out of the following network cable : Co-axial Cable, Ethernet Cable, Single Pair Telephone Cable. e) The institute is planning to connect its admission office in Bangalore, which is 1960km from institute. Which type of network out of LAN, MAN or WAN will be formed ? Justify your answer. a. Most suitable place to install the server is HR Unit b. Bus/Star topology c. Switch d. Ethernet Cable 39. Consider the following tables WORKERS and DESIG. Write SQL commands for the statements (i) to (iv) and give outputs for SQL queries (v) to (viii) : 5 12 Chinthala Vijaya Kumar PGTCS
  • 13. WORKERS W_ID FIRSTNAME LASTNAME GENDER ADDRESS CITY 102 Sam Tones M 33 Elm St Paris 105 Sarah Ackerman F U.S. 110 New York 144 Manila Sengupta F 24 Friends Street New Delhi 210 George Smith M 83 First Street Howard 255 Mary Jones F 842,Vine Ave. Losantiville 300 Robert Samuel M 9 Fifth Cross Washington 335 Henry Williams M 12 Moore Street Boston 403 Ronny Lee M 121 Harrison St. New York 451 Pat Thompson M 11 Red Road Paris DESIG W_ID SALARY BENEFITS DESIGNATION 102 75000 15000 Manager 105 85000 25000 Director 144 70000 15000 Manager 210 75000 12500 Manager 255 50000 12000 Clerk 300 45000 10000 Clerk 335 40000 10000 Clerk 400 32000 7500 Salesman 451 28000 7500 Salesman (i) To display W_ID, Firstname, Address and City of all employees living in New York from the table WORKERS. (ii) To display the content of WORKERS table in ascending order of LASTNAME. (iii) To display First Name, Worker ID and Address of male Workers only. (iv) To display the Minimum salary among Managers and Clerks from the table DESIG. (v) To display First Name and Salary from Workers and Desig Table for each worker. (i) SELECT W_ID,FIRSTNAME, ADDRESS, CITY FROM WORKERS WHERE CITY=’New York’; (ii) SELECT * FROM WORKERS ORDER BY LASTNAME; (iii) SELECT FIRSTNAME, W_ID, ADDRESS FROM WORKERS WHERE GENDER=’M’; (iv) SELECT MIN(SALARY) FROM DESIG WHERE DESIGNATION IN(‘MANAGER’, ‘CLERKS’); (v) SELECT FIRSTNAME, SALARY FROM WORKERS, DESIG WHERE WORKERS.W_ID=DESIG.W_ID; 40. A binary file “STOCK.DAT” has structure [ITEMID, ITEMNAME, QUANTITY, PRICE]. (i) Write a user defined function MakeFile( ) to input data for a record and add to Book.dat. (ii) Write a function GetPrice(ITEMID) in Python which accepts the ITEMID as parameter and return PRICE of the Item stored in Binary file STOCK.DAT. OR 5 13 Chinthala Vijaya Kumar PGTCS
  • 14. A binary file “EMPLOYEE.DAT” has structure (EMPID, EMPNAME, SALARY). Write a function CountRec( ) in Python that would read contents of the file “EMPLOYEE.DAT” and display the details of those Employees whose Salary is above 20000. Also display number of employees having Salary more than 20000. (i)import pickle def MakeFile(): fobj=open("STOCK.DAT",'ab') itemid=input("Enter ITEM ID") itemname=input("Enter name of the Item") Q=int(input("Enter the quantity of Item")) price=float(input("Enter the price")) rec=[itemid,itemname,Q,price] pickle.dump(rec,fobj) fobj.close() (ii) def GetPrice(ITEMID): fobj=open("STOCK.DAT",'rb') try: while True: rec=pickle.load(fobj) if(rec[0]in str(ITEMID)): print("Price of ", rec[0], "item is",rec[3]) return rec[0] except: fobj.close() OR import pickle def CountRec(): fobj=open("EMPLOYEE",'rb') num=0 try: while True: rec=pickle.load(fobj) if(rec[2]>20000): print(rec[0],rec[1],rec[2]) num=num+1 except: fobj.close() return num Using any correct code giving the same result is also accepted 14 Chinthala Vijaya Kumar PGTCS