KENDRIYA VIDYALAYA SANGATHAN, AHMEDABAD REGION
FIRST PRE-BOARD EXAMINATION, 2020
SUBJECT : COMPUTER SCIENCE (NEW) – 083 M.M : 70
CLASS : XII TIME : 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 sub-parts. 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 questions 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.
Questi PART – A Marks
Allocated
on No.
1
Section – I 1
Select the most appropriate option out of the options given for each 1
1
question. Attempt any 15 questions from question no. 1 to 21.
1 Which of the following is not a valid identifier name in Python? Justify reason
for it not being a valid name.
a) 5Total b) _Radius c) pie d)While
2 Find the output -
>>>A = [17, 24, 15, 30]
>>>A.insert( 2, 33)
>>>print ( A [-4])
3 Name the Python Library modules which need to be imported to invoke the
following functions:
(i) ceil() (ii) randrange()
4 Which of the following are valid operator in Python:
(i) */ (ii) is (iii) ^ (iv) like
Page 1 of 10
5 Which of the following statements will create a tuple ? 1
(a) Tp1 = (“a”, “b”)
(b) Tp1= (3) * 3
(c) Tp1[2] = (“a”, “b”)
(d) None of these
6 What will be the result of the following code? 1
>>>d1 = {“abc” : 5, “def” : 6, “ghi” : 7}
>>>print (d1[0]) (c) {“abc”:5} (d) Error
(a) abc (b) 5
7 Find the output of the following: 1
>>>S = 1, (2,3,4), 5, (6,7)
>>> len(S)
8 Which of the following are Keywords in Python ? 1
(i) break (ii) check (iii) range (iv) while
9 __________ is a specific condition in a network when more data packets are 1
coming to network device than they can handle and process at a time.
10 Ravi received a mail from IRS department on clicking “Click –Here”, he was 1
taken to a site designed to imitate an official looking website, such as
IRS.gov. He uploaded some important information on it.
Identify and explain the cybercrime being discussed in the above scenario.
11 Which command is used to change the number of columns in a table? 1
12 Which keyword is used to select rows containing column that match a 1
wildcard pattern?
13 The name of the current working directory can be determined using ______ 1
method.
14 Differentiate between Degree and Cardinality. 1
15 Give one example of each – Guided media and Unguided media 1
16 Which of the following statement create a dictionary? 1
a) d = { }
b) d = {“john”:40, “peter”:45}
c) d = (40 : “john”, 45 : “peter”}
d) d = All of the mentioned above
Page 2 of 10
17 Find the output of the following: 1
>>>Name = “Python Examination”
>>>print (Name [ : 8 : -1])
18 All aggregate functions except ___________ ignore null values in their input 1
collection.
a) Count (attribute) b) Count (*) c) Avg () d) Sum ()
19 Write the expand form of Wi-Max. 1
20 Group functions can be applied to any numeric values, some text types and 1
DATE values. (True/False)
21 _______________ is a network device that connects dissimilar networks. 1
Section – II
Both the Case study based questions are compulsory. Attempt any 4
sub parts from each question. Each question carries 1 mark.
22 A department is considering to maintain their worker data using SQL to store 1*4=4
the data. As a database administer, Karan has decided that :
Name of the database - Department
Name of the table - WORKER
The attributes of WORKER are as follows:
WORKER_ID - character of size 3
FIRST_NAME – character of size 10
LAST_NAME– character of size 10
SALARY - numeric
JOINING_DATE – Date
DEPARTMENT – character of size 10
WORKER_I FIRST_NA LAST_NAM SALARY JOINING_D DEPARTM
ENT
D ME E ATE HR
Admin
001 Monika Arora 100000 2014-02-20 HR
Admin
002 Niharika Diwan 80000 2014-06-11 Admin
Account
003 Vishal Singhal 300000 2014-02-20 Account
Admin
004 Amitabh Singh 500000 2014-02-20
005 Vivek Bhati 500000 2014-06-11
006 Vipul Diwan 200000 2014-06-11
007 Satish Kumar 75000 2014-02-20
008 Monika Chauhan 80000 2014-04-11
a) Write a query to create the given table WORKER. 1
1
b) Identify the attribute best suitable to be declared as a primary key. 1
c) Karan wants to increase the size of the FIRST_NAME column from
10 to 20 characters. Write an appropriate query to change the size.
Page 3 of 10
d) Karan wants to remove all the data from table WORKER from the 1
database Department. Which command will he use from the
following:
i) DELETE FROM WORKER;
ii) DROP TABLE WORKER;
iii) DROP DATABASE Department;
iv) DELETE * FROM WORKER;
e) Write a query to display the Structure of the table WORKER, i.e. name
of the attribute and their respective data types.
23 Ashok Kumar of class 12 is writing a program to create a CSV file 1*4=4
“empdata.csv” with empid, name and mobile no and search empid and
display the record. He has written the following code. As a programmer, help
him to successfully execute the given task.
import _____ #Line1
fields=['empid','name','mobile_no']
rows=[['101','Rohit','8982345659'],['102','Shaurya','8974564589'],
['103','Deep','8753695421'],['104','Prerna','9889984567'],
['105','Lakshya','7698459876']]
filename="empdata.csv"
with open(filename,'w',newline='') as f:
csv_w=csv.writer(f,delimiter=',')
csv_w.___________ #Line2
csv_w.___________ #Line3
with open(filename,'r') as f:
csv_r=______________(f,delimiter=',') #Line4
ans='y'
while ans=='y':
found=False
emplid=(input("Enter employee id to search="))
for row in csv_r:
if len(row)!=0:
if _____==emplid: #Line5
print("Name : ",row[1])
print("Mobile No : ",row[2])
found=True
Page 4 of 10
break
if not found:
print("Employee id not found")
ans=input("Do you want to search more? (y)")
(a) Name the module he should import in Line 1. 1
(b) Write a code to write the fields (column heading) once from fields list 1
in Line2.
(c) Write a code to write the rows all at once from rows list in Line3. 1
(d) Fill in the blank in Line4 to read the data from a csv file. 1
(e) Fill in the blank to match the employee id entered by the user with the 1
empid of record from a file in Line5.
PART – B
Section – I
24 Evaluate the following expressions: 2
a) 12*(3%4)//2+6
b) not 12 > 6 and 7 < 17 or not 12 < 4
25 Define and explain all parts of a URL of a website. i.e. 2
https://www.google.co.in. It has various parts.
OR
Define cookies and hacking.
26 Expand the following terms: 2
a) IPR b) SIM c) IMAP d)HTTP
27 What is the difference between a Local Scope and Global Scope ? Also, give 2
a suitable Python code to illustrate both.
OR
Define different types of formal arguments in Python, with example.
28 Observe the following Python code very carefully and rewrite it after 2
removing all syntactical errors with each correction underlined.
DEF result_even( ):
x = input(“Enter a number”)
if (x % 2 = 0) :
print (“You entered an even number”)
Page 5 of 10
else:
print(“Number is odd”)
even ( )
29 What possible output(s) are expected to be displayed on screen at the time 2
of execution of the program from the following code? Also specify the
minimum values that can be assigned to each of the variables BEGIN and
LAST.
import random
VALUES = [10, 20, 30, 40, 50, 60, 70, 80]
BEGIN = random.randint (1, 3)
LAST = random.randint(2, 4)
for I in range (BEGIN, LAST+1):
print (VALUES[I], end = "-")
(i) 30-40-50- (ii) 10-20-30-40-
(iii) 30-40-50-60- (iv) 30-40-50-60-70-
30 What is the difference between Primary Key and Foreign Key? Explain with 2
Example.
31 What is the use of commit and rollback command in MySql. 2
32 Differentiate between WHERE and HAVING clause. 2
33 Find and write the output of the following Python code: 2
def makenew(mystr):
newstr = " "
count = 0
for i in mystr:
if count%2 !=0:
newstr = newstr+str(count)
else:
if i.islower():
newstr = newstr+i.upper()
else:
newstr = newstr+i
count +=1
newstr = newstr+mystr[:1]
Page 6 of 10
print("The new string is :", newstr)
makenew("sTUdeNT")
SECTION - II
34 Write a function bubble_sort (Ar, n) in python, Which accepts a list Ar of 3
numbers and n is a numeric value by which all elements of the list are sorted
by Bubble sort Method.
35 Write a function in python to count the number lines in a text file ‘Country.txt’ 3
which is starting with an alphabet ‘W’ or ‘H’. If the file contents are as follows:
Whose woods these are I think I know.
His house is in the village though;
He will not see me stopping here
To watch his woods fill up with snow.
The output of the function should be:
W or w : 1
H or h : 2
OR
Write a user defined function to display the total number of words present in
the file.
A text file “Quotes.Txt” has the following data written in it:
Living a life you can be proud of doing your best Spending your time with
people and activities that are important to you Standing up for things that are
right even when it’s hard Becoming the best version of you.
The countwords() function should display the output as:
Total number of words : 40
36 Write the output of the SQL queries (i) to (iii) based on the table: Employee 3
Ecode Name Dept DOB Gender Designation Salary
101
102 Sunita Sales 06-06-1995 F Manager 25000
103
104 Neeru Office 05-07-1993 F Clerk 12000
105
106 Raju Purchase 05-06-1994 M Manager 26000
(i) Neha Sales 08-08-1995 F Accountant 18000
Nishant Office 08-10-1995 M Clerk 10000
Vinod Purchase 12-12-1994 M Clerk 10000
Select sum(Salary) from Employee where Gender = ‘F’ and Dept =
‘Sales’;
(ii) Select Max(DOB), Min(DOB) from Employee;
Page 7 of 10
(iii) Select Gender, Count(*) from Employee group by Gender;
37 Write a function AddCustomer(Customer) in Python to add a new Customer 3
information NAME into the List of CStack and display the information.
OR
Write a function DeleteCustomer() to delete a Customer information from a
list of CStack. The function delete the name of customer from the stack.
SECTION - III
38 Intelligent Hub India is a knowledge community aimed to uplift the standard 5
of skills and knowledge in the society. It is planning to setup its training
centres in multiple towns and villages of India with its head offices in the
nearest cities. They have created a model of their network with a city, a town
and 3 villages as given.
As a network consultant, you have to suggest the best network related
solution for their issues/problems raised in (i) to (v) keeping in mind the
distance between various locations and given parameters.
Page 8 of 10
Note:
* In Villages, there are community centres, in which one room has been given
as training center to this organization to install computers.
* The organization has got financial support from the government and top IT
companies.
1. Suggest the most appropriate location of the SERVER in the YHUB (out
of the 4 locations), to get the best and effective connectivity. Justify your
answer.
2. Suggest the best wired medium and draw the cable layout (location to
location) to efficiently connect various locations within the YHUB.
3. Which hardware device will you suggest to connect all the computers
within each location of YHUB?
4. Which server/protocol will be most helpful to conduct live interaction of
Experts from Head office and people at YHUB locations?
5. Suggest a device/software and its placement that would provide data
security for the entire network of the YHUB.
39 Write SQL commands for the following queries (i) to (v) based on the relation 5
Trainer and Course given below:
Page 9 of 10
(i) Display the Trainer Name, City & Salary in descending order of
their Hiredate.
(ii) To display the TNAME and CITY of Trainer who joined the Institute
in the month of December 2001.
(iii) To display TNAME, HIREDATE, CNAME, STARTDATE from
tables TRAINER and COURSE of all those courses whose FEES
is less than or equal to 10000.
(iv) To display number of Trainers from each city.
(v) To display the Trainer ID and Name of the trainer who are not
belongs to ‘Mumbai’ and ‘DELHI’
40 Given a binary file “emp.dat” has structure (Emp_id, Emp_name, 5
Emp_Salary). Write a function in Python countsal() in Python that would read
contents of the file “emp.dat” and display the details of those employee
whose salary is greater than 20000.
OR
A binary file “Stu.dat” has structure (rollno, name, marks).
(i) Write a function in Python add_record() to input data for a record
and add to Stu.dat.
(ii) Write a function in python Search_record() to search a record from
binary file “Stu.dat” on the basis of roll number.
*****
Page 10 of 10
KENDRIYA VIDYALAYA SANGATHAN, AHMEDABAD REGION
FIRST PRE-BOARD EXAMINATION, 2020 M.M : 70
SUBJECT : COMPUTER SCIENCE (NEW) – 083 TIME : 3 HOURS
CLASS : XII
MARKING SCHEME
Question Part – A Marks
Allocated
No.
1
Section – I
1
1 a) 5Total 1
1
Reason : An identifier cannot start with a digit. 1
1
2 24 1
1
3 (i) math (ii) random (½ mark for each module) 1
1
4 Valid operators : (ii) is (iii) ^ (½ mark for each operator) 1
1
5 (a) Tp1 = (“a”, “b”) 1
1
6 (d) Error
1
7 Ans. 4
1
8 (i) break (iv) while (½ mark for each option) 1
1
9 Network Congestion 1
1
10 It is an example of phishing 1
11 ALTER
12 LIKE
13 getcwd()
14 Degree – it is the total number of columns in the table.
Cardinality – it is the total number of tuples/Rows in the table.
15 Guided – Twisted pair, Coaxial Cable, Optical Fiber (any one)
Unguided – Radio waves, Satellite, Micro Waves (any one)
16 d) d = All of the mentioned above
17 Answer - noitanima
18 b) Count(*)
19 Wi-Max – Worldwide Interoperability for Microwave Access
20 True
21 Gateway
Page 1 of 8
Section – II
Both the Case study based questions are compulsory. Attempt any
4 sub parts from each question. Each question carries 1 mark.
22 Answers: 1*4=4
a) Create table WORKER(WORKER_ID varchar(3), FIRST_NAME
varchar(10), LAST_NAME varchar(10), SALARY integer,
JOINING_DATE Date, DEPARTMENT varchar(10));
b) WORKER_ID
c) alter table worker modify FIRST_NAME varchar(20);
d) DELETE FROM WORKER;
e) Desc WORKER / Describe WORKER;
23 Answers: 1*4=4
a) csv
b) writerow(fields)
c) writerows(rows)
d) csv.reader
e) row[0]
Part – B
Section – I
24 a) 24 2
b) True
25 URL stands for Uniform Resource Locator and it is the complete address 2
of a website or web server, e.g.https://www.google.co.in- name of the
protocol : https, Web service : www, name of the server: google, DNS
Name : co, Name of the country site belongs : in (india)
OR
Cookies: .Cookies are messages that a web server transmits to a web
browser so that the web server can keep track of the user’s activity on a
specific website. Cookies are saved in the form of text files in the client
computer.
Hacking: It is a process of accessing a computer system or network
without knowing the access authorization credential of that system.
Hacking can be illegal or ethical depending on the intention of the
hacker.
Page 2 of 8
26 a) IPR – Intellectual Property Rights 2
b) SIM – Subscriber’s Identity Module
c) IMAP – Internet Message Access Protocol
d) HTTP – Hyper text transfer Protocol
27 A local scope is variable defined within a function. Such variables are 2
said to have local scope. With example
A global variable is a variable defined in the ;main’ program (_main_
section). Such variables are said to have global scope. With example
OR
Python supports three types of formal arguments :
1) Positional arguments (Required arguments) - When the function call
statement must match the number and order of arguments as defined in
the function definition. Eg. def check (x, y, z) :
2) Default arguments – A parameter having default value in the function
header is known as default parameter. Eg. def interest(P, T, R=0.10) :
3) Keyword (or named) arguments- The named arguments with assigned
value being passed in the function call statement. Eg. interest (P=1000,
R=10.0, T = 5)
28 def result_even( ): 2
x = int(input(“Enter a number”))
if (x % 2 == 0) :
print (“You entered an even number”)
else:
print(“Number is odd”)
result_even( )
29 OUTPUT – (i) 30-40-50- 2
Minimum value of BEGIN: 1
Minimum value of LAST: 2
30 Primary Key: 2
A primary key is used to ensure data in the specific column is unique. It
is a column cannot have NULL values. It is either an existing table
column or a column that is specifically generated by the database
according to a defined sequence.
Page 3 of 8
Example: Refer the figure –
STUD_NO, as well as STUD_PHONE both, are candidate keys for
relation STUDENT but STUD_NO can be chosen as the primary key
(only one out of many candidate keys).
Foreign Key:
A foreign key is a column or group of columns in a relational database
table that provides a link between data in two tables. It is a column (or
columns) that references a column (most often the primary key) of
another table.
Example: Refer the figure –
STUD_NO in STUDENT_COURSE is a foreign key to STUD_NO in
STUDENT relation.
31 Commit : MySqlConnection.commit() method sends a COMMIT 2
statement to the MySql server, committing the current transaction.
Rollback: MySqlConnection.rollback reverts the changes made by the
current transaction.
32 WHERE clause is used to select particular rows that satisfy a condition 2
whereas HAVING clause is used in connection with the aggregate
function, GROUP BY clause.
For ex. – select * from student where marks > 75;
This statement shall display the records for all the students who have
scored more than 75 marks.
On the contrary, the statement – select * from student group by stream
having marks > 75; shall display the records of all the students grouped
together on the basis of stream but only for those students who have
scored marks more than 75.
Page 4 of 8
33 Ans: The new string is : S1U3E5Ts 2
(1/2 mark for each change i.e. S 1 3 E 5 s )
SECTION - II
34 def bubble_sort(Ar, n): 3
print ("Original list:", Ar)
for i in range(n-1):
for j in range(n-i-1):
if Ar[j] > Ar[j+1]:
Ar[j], Ar[j+1] = Ar[j+1], Ar[j]
print ("List after sorting :", Ar)
Note: Using of any correct code giving the same result is also
accepted.
35 def count_W_H(): 3
f = open (“Country.txt”, “r”)
W,H = 0,0
r = f.read()
for x in r:
if x[0] == “W” or x[0] == “w”:
W=W+1
elif x[0] == “H” or x[0] == “h”:
H=H+1
f.close()
print (“W or w :”, W)
print (“H or h :”, H)
OR
def countwords():
s = open("Quotes.txt","r")
f = s.read()
z = f.split ()
count = 0
for I in z:
count = count + 1
print ("Total number of words:", count)
Note: Using of any correct code giving the same result is also accepted.
Page 5 of 8
36 OUTPUT:- 3
(i) 43000
(ii) Max (DOB) Min(DOB)
08-10-1995 05-071993
(iii) Gender Count(*)
F3
M3
37 def AddCustomer(Customer): 3
CStake.append(Customer)
If len(CStack)==0:
print (“Empty Stack”)
else:
print (CStack)
OR
def DeleteCustomer():
if (CStack ==[]):
print(“There is no Customer!”)
else:
print(“Record deleted:”,CStack.pop())
Section – III
38 Answers: 5
(i) YTOWN
Justification:-Since it has the maximum number of computers.
It is closet to all other locatios. 80-20 Network rule.
(ii) Optical Fiber
Layout:
(iii) Switch or Hub
(iv) Video conferencing or VoIP or any other correct service/protocol
(v) Firewall- Placed with the Server at YHUB.
Page 6 of 8
39 ANSWERS:- 5
(i) SELECT TNAME, CITY, SALARY FROM TRAINER ORDER BY HIREDATE;
(ii) SELECT TNAME, CITY FROM TRAINER WHERE HIREDATE BETWEEN
‘2001-12-01’ AND ‘2001-12-31’;
(iii) SELECT TNAME, HIREDATE, CNAME, STARTDATE FROM TRAINER,
COURSE WHERE TRAINER.TID=COURSE.TID AND FEES<=10000;
(iv) SELECT CITY, COUNT(*) FROM TRAINER GROUP BY CITY;
(v) SELECT TID, TNAME, FROM TRAINER WHERE CITY NOT IN(‘DELHI’,
‘MUMBAI’);
40 Answer:- (Using of any correct code giving the same result is also 5
accepted)
import pickle
def countsal():
f = open (“emp.dat”, “rb”)
n=0
try:
while True:
rec = pickle.load(f)
if rec[2] > 20000:
print(rec[0], rec[1], rec[2], sep=”\t”)
num = num + 1
except:
f.close()
OR
import pickle
def add_record():
fobj = open(“Stu.dat”,”ab”)
rollno =int(input(“Roll no:”))
name = int(input(“Name:”))
marks = int(input(“Marks:”))
data = [rollno, name, marks]
pickle.dump(data,fobj)
fobj.close()
def Search_record():
f = open(“Stu.dat”, “rb”)
Page 7 of 8
stu_rec = pickle.load(f)
found = 0
rno = int(input(“Enter the roll number to search:”))
try:
for R in stu_rec:
if R[0] == rno:
print (“Successful Search:, R[1], “Found!”)
found = 1
break
except:
if found == 0:
print (“Sorry, record not found:”)
f.close()
*****
Page 8 of 8
XII/PB/2021/CS/SET-1
Kendriya Vidyalaya Sangathan, Regional Office, Bhopal
Pre-Board Examination 2020-21
Class- XII(Computer Science (083))
M.M.:70 Time: 3 hrs.
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 sub-
parts. 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 questions
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 no 1 to 21.
1. Find the invalid identifier from the following 1
a) def b) For c)_bonus d)First_Name
2. Given the lists Lst=[‘C’,’O’,’M’,’P’,’U’,’T’,’E’,’R’] , write the output of: 1
print(Lst[3:6])
3. Function of writer object is used to send data to csv file to store. 1
4. What will be the output of following program: 1
a='hello' b='virat'
for i in range(len(a)): print(a[i],b[i])
5. Give Output:
colors=["violet", "indigo", "blue", "green", "yellow", "orange", "red"]
del colors[4] 1
colors.remove("blue")
colors.pop(3)
print(colors)
6. Which statement is correct for dictionary?
(i) A dictionary is a ordered set of key:value pair 1
(ii) each of the keys within a dictionary must be unique
(iii) each of the values in the dictionary must be unique
(iv) values in the dictionary are immutable
Page 1 of 9
XII/PB/2021/CS/SET-1
7. Identify the valid declaration of Rec: 1
Rec=(1,‟Vikrant,50000) 1
(i)List (ii)Tuple (iii)String (iv)Dictionary 1
1
8. Find and write the output of the following python code: 1
1
def myfunc(a): 1
a=a+2 1
a=a*2 1
return a 1
print(myfunc(2)) 1
1
9. Name the protocol that is used to transfer file from one computer to another.
10. Raj is a social worker, one day he noticed someone is writing insulting or demeaning
comments on his post. What kind of Cybercrime Raj is facing?
11. Which command is used to change the existing information of table?
12. Expand the term: RDBMS
13. Write an Aggregate function that is used in MySQL to find No. of Rows in the
database Table
14. For each attribute of a relation, there is a set of permitted values, called the of
that attribute.
a. Dictionaries
b. Domain
c. Directory
d. Relation
15. Name the Transmission media which consists of an inner copper core and a second
conducting outer sheath.
16. Identify the valid statement for list L=[1,2,”a”]:
(i) L.remove("2")
(ii) L.del(2)
(iii) del L[2]
(iv) del L[“a”]
17. Find and write the output of the following python code:
x = "Python"
print(x[ : :-1])
print(x)
18. In SQL, write the query to display the list of databases stored in MySQL.
Page 2 of 9
XII/PB/2021/CS/SET-1
19. Write the expanded form of GPRS? 1
20. Which is not a constraint in SQL?
a) Unique
b) Distinct 1
c) Primary key
d) check
21. Define Bandwidth? 1
Section-II
Both the Case study based questions are compulsory. Attempt any 4 sub parts from
each question. Each question carries 1 mark
22. Observe the following table and answer the question (a) to (e) (Any 04)
TABLE: VISITOR
VisitorID VisitorName ContactNumber
V001 ANAND 9898989898
V002 AMIT 9797979797
V003 SHYAM 9696969696
V004 MOHAN 9595959595
(a) Write the name of most appropriate columns which can be considered as 1
1
Candidate keys? 1
1
(b) Out of selected candidate keys, which one will be the best to choose as Primary
1
Key?
(c) What is the degree and cardinality of the table?
(d) Insert the following data into the attributes VisitorID, VisitorName and
ContactNumber respectively in the given table VISITOR.
VisitorID = “V004”, VisitorName= “VISHESH” and ContactNumber= 9907607474
(e) Remove the table VISITOR from the database HOTEL. Which command will he
used from the following:
a) DELETE FROM VISITOR;
b) DROP TABLE VISITOR;
c) DROP DATABASE HOTEL;
d) DELETE VISITOR FROM HOTEL;
23. Priti of class 12 is writing a program to create a CSV file “emp.csv”. She has written
the following code to read the content of file emp.csv and display the employee record
whose name begins from “S‟ also show no. of employee with first letter “S‟ out of total
record. As a programmer, help her to successfully execute the given task.
Consider the following CSV file (emp.csv):
Page 3 of 9
1,Peter,3500 XII/PB/2021/CS/SET-1
2,Scott,4000
3,Harry,5000
4,Michael,2500
5,Sam,4200
import ________ # Line 1
def SNAMES():
with open(_________) as csvfile: # Line 2
myreader = csv._______(csvfile, delimiter=',') # Line 3
count_rec=0
count_s=0
for row in myreader:
if row[1][0].lower()=='s':
print(row[0],',',row[1],',',row[2])
count_s+=1
count_rec+=1
print("Number of 'S' names are ",count_s,"/",count_rec)
(a) Name the module he should import in Line 1 1
(b) In which mode, Priti should open the file to print data. 1
(c) Fill in the blank in Line 2 to open the file. 1
(d) Fill in the blank in Line3 to read the data from a csv file. 1
(e) Write the output he will obtain while executing the above program. 1
PART-B 2
Section-I 2
2
24. If given A=2,B=1,C=3, What will be the output of following expressions:
(i) print((A>B) and (B>C) or(C>A)) 2
(ii) print(A**B**C)
25 What is Trojan? Any two type of activities performed by Trojan
OR
What is the difference between HTML and XML?
26 Expand the following terms:
a. HTTP b. POP3 c. VOIP d.TCP
27 What do you understand the default argument in function? Which function parameter
must be given default argument if it is used? Give example of function header to
illustrate default argument
OR
Ravi a python programmer is working on a project, for some requirement, he has to
define a function with name CalculateInterest(), he defined it as:
def CalculateInterest (Principal, Rate=.06,Time): # code
But this code is not working, Can you help Ravi to identify the error in the above function
and what is the solution.
Page 4 of 9
XII/PB/2021/CS/SET-1
28 Rewrite the following Python program after removing all the syntactical errors (if
any), underlining each correction:
def checkval:
x = input("Enter a number")
if x % 2 =0: 2
print (x, "is even")
elseif x<0:
print (x, "should be positive")
else;
print (x, "is odd")
29 What possible outputs(s) are expected to be displayed on screen at the time of
execution of the program from the following code? Also specify the maximum values
that can be assigned to each of the variables FROM and TO.
import random 2
AR=[20,30,40,50,60,70]
FROM=random.randint(1,3)
TO=random.randint(2,4)
for K in range(FROM,TO):
print (AR[K],end=”#“)
(i)10#40#70# (ii)30#40#50# (iii)50#60#70# (iv)40#50#70#
30 Define Primary Key of a relation in SQL. Give an Example using a dummy table. 2
2
31 Consider the following Python code is written to access the record of CODE passed 2
to function: Complete the missing statements:
def Search(eno):
#Assume basic setup import, connection and cursor is created
query="select * from emp where empno=________".format(eno)
mycursor.execute(query)
results = mycursor._________
print(results)
32 Differentiate between DDL and DML with one Example each.
33 What will be the output of following program: 2
s="welcome2kv"
n = len(s)
m=""
for i in range(0, n):
if (s[i] >= 'a' and s[i] <= 'm'):
m = m +s[i].upper()
elif (s[i] >= 'n' and s[i] <= 'z'):
m = m +s[i-1]
elif (s[i].isupper()):
m = m + s[i].lower()
else:
m = m +'#'
print(m)
Page 5 of 9
XII/PB/2021/CS/SET-1
Section-II 3
34 Write code in Python to calculate and display the frequency of each item in a list.
35 Write a function COUNT_AND( ) in Python to read the text file “STORY.TXT” and
count the number of times “AND” occurs in the file. (include AND/and/And in the
counting) 3
OR
Write a function DISPLAYWORDS( ) in python to display the count of words starting
with “t” or “T” in a text file ‘STORY.TXT’.
36 Write a output for SQL queries (i) to (iii), which are based on the table: SCHOOL and
ADMIN given below:
TABLE: SCHOOL
CODE TEACHERNAME SUBJECT DOJ PERIODS EXPERIENCE
1001 RAVI SHANKAR
1009 PRIYA RAI ENGLISH 12/03/2000 24 10
1203 LISA ANAND
1045 YASHRAJ PHYSICS 03/09/1998 26 12
1123 GANAN
1167 HARISH B ENGLISH 09/04/2000 27 5
1215 UMESH
MATHS 24/08/2000 24 15
PHYSICS 16/07/1999 28 3
CHEMISTRY 19/10/1999 27 5
PHYSICS 11/05/1998 22 16
TABLE: ADMIN
CODE GENDER DESIGNATION 3
1001 MALE VICE PRINCIPAL
1009 FEMALE COORDINATOR
1203 FEMALE COORDINATOR
1045 MALE HOD
1123 MALE SENIOR TEACHER
1167 MALE SENIOR TEACHER
1215 MALE HOD
i) SELECT SUM (PERIODS), SUBJECT FROM SCHOOL GROUP BY SUBJECT;
ii) SELECT TEACHERNAME, GENDER FROM SCHOOL, ADMIN WHERE
DESIGNATION = ‘COORDINATOR’ AND SCHOOL.CODE=ADMIN.CODE;
iii) SELECT COUNT (DISTINCT SUBJECT) FROM SCHOOL;
Page 6 of 9
XII/PB/2021/CS/SET-1
37 Write a program to perform push operations on a Stack containing Student details as
given in the following definition of student node: 3
RNo integer
Name String
Age integer
def isEmpty(stk):
if stk == [ ]:
return True
else:
return False
def stk_push(stk, item):
# Write the code to push student details using stack.
OR
Write a program to perform pop operations on a Stack containing Student details as
given in the following definition of student node:
RNo integer
Name String
Age integer
def isEmpty(stk):
if stk == [ ]:
return True
else:
return False
def stk_pop(stk):
# Write the code to pop a student using stack.
Section-III
38 PVS Computers decided to open a new office at Ernakulum, the office consist of Five
Buildings and each contains number of computers. The details are shown below.
Building-2 5
Building-1 Building-3
Building-5 Building-4
Page 7 of 9
XII/PB/2021/CS/SET-1
Distance between the buildings Building No of computers
1 40
Building 1 and 2 20 Meters 2 45
Building 2 and 3 50 Meters 3 110
Building 3 and 4 120 Meters 4 70
Building 3 and 5 70 Meters 5 60
Building 1 and 5 65 Meters
Building 2 and 5 50 Meters
Computers in each building are networked but buildings are not networked so far. The
Company has now decided to connect building also.
(i) Suggest a cable layout for connecting the buildings
(ii) Do you think anywhere Repeaters required in the campus? Why
(iii) The company wants to link this office to their head office at Delhi
(a) Which type of transmission medium is appropriate for such a link?
(b) What type of network would this connection result into?
(iv) Where server is to be installed? Why?
(v) Suggest the wired Transmission Media used to connect all buildings efficiently.
39 Write SQL queries for (i) to (v), which are based on the table: SCHOOL and ADMIN
TABLE: SCHOOL
CODE TEACHERNAME SUBJECT DOJ PERIODS EXPERIENCE
1001 RAVI SHANKAR ENGLISH 12/03/2000 24 10
1009 PRIYA RAI 12
1203 LISA ANAND PHYSICS 03/09/1998 26 5
1045 YASHRAJ 15
1123 GANAN ENGLISH 09/04/2000 27 3
1167 HARISH B 5
1215 UMESH MATHS 24/08/2000 24 16
PHYSICS 16/07/1999 28
CHEMISTRY 19/10/1999 27
PHYSICS 11/05/1998 22 5
TABLE: ADMIN
CODE GENDER DESIGNATION
1001 MALE VICE PRINCIPAL
1009 FEMALE COORDINATOR
1203 FEMALE COORDINATOR
1045 MALE HOD
1123 MALE SENIOR TEACHER
1167 MALE SENIOR TEACHER
1215 MALE HOD
Page 8 of 9
XII/PB/2021/CS/SET-1
i) To decrease period by 10% of the teachers of English subject.
ii) To display TEACHERNAME, CODE and DESIGNATION from tables SCHOOL and
ADMIN whose gender is male.
iii) To Display number of teachers in each subject.
iv) To display details of all teachers who have joined the school after 01/01/1999 in
descending order of experience.
v) Delete all the entries of those teachers whose experience is less than 10 years in
SCHOOL table.
40 Write a function SCOUNT( ) to read the content of binary file “NAMES.DAT‟ and
display number of records (each name occupies 20 bytes in file ) where name begins
from “S‟ in it.
For. e.g. if the content of file is:
SACHIN
AMIT
AMAN
SUSHIL
DEEPAK
HARI SHANKER
Function should display
Total Names beginning from “S” are 2 5
OR
Consider the following CSV file (emp.csv):
Sl,name,salary
1,Peter,3500
2,Scott,4000
3,Harry,5000
4,Michael,2500
5,Sam,4200
Write Python function DISPEMP( ) to read the content of file emp.csv and display only
those records where salary is 4000 or above
*************************************************************************
Page 9 of 9
XII/PB/2021/CS/SET-1
Kendriya Vidyalaya Sangathan, Regional Office, Bhopal
Pre-Board Examination2020-21
Class- XII (Computer Science (083))
Marking Scheme
PART-A
Section-I
Select the most appropriate option out of the options given for each question. Attempt any 15
questions from question no 1 to 21. (award 1 mark for each correct answer)
1. a) def 1
2. PUT 1
3. writerow() 1
4. h v 1
1
ei
lr
la
ot
5. ['violet', 'indigo', 'green', 'red']
6. (ii) each of the keys within a dictionary must be unique 1
7. (ii)Tuple 1
8. 8 1
9. FTP 1
10. Raj is a social worker, one day he noticed someone is writing insulting or demeaning 1
comments on his post. What kind of Cybercrime Raj is facing?
11. UPDATE 1
1
12. Relational Database management System 1
13. Count (*) 1
14. (b) Domain 1
15. Co-axial
16. (iii) del L[2] 1
17. nohtyP 1
Python
18. show databases 1
19. General Packet Radio Service (GPRS) 1
20. b) Distinct 1
21. a band of frequencies used for sending electronic signals 1
XII/PB/2021/CS/SET-1
Section-II
Both the Case study based questions are compulsory. Attempt any 4 sub parts from each
question. Each question carries 1 mark
22. (a) VIsitorID and ContactNumber 1
(b) VisitorID 1
(c) Degree= 3 1
Cardinality=4
(d) insert into VISITOR values (“V004”, “VISHESH”,9907607474) 1
(b) DROP TABLE VISITOR; 1
1
23. (a) csv 1
1
(b) read mode 1
(c) 'emp.csv' 1
(d) reader 2
(e) 2,Scott,4000
5,Sam,4200
Number of “S” names are 2/5
PART-B
Section-I
24. (i) True
(ii) 2
25 A Trojan horse or Trojan is a type of malware that is often disguised as legitimate software.
Trojans can be employed by cyber-thieves and hackers trying to gain access to users'
systems. activities performed by Trojan can be:
Deleting data
Blocking data
Modifying data
Copying data
Disrupting the performance of computers or computer networks
OR
HTML XML 2
HTML is used to display XML is a software and hardware
data and focuses on how data independent tool used to transport and
looks. store data. It focuses on what data is.
HTML is a markup XML provides a framework to define
language itself. markup languages.
HTML is not case sensitive. XML is case sensitive.
HTML is a presentation language.
XML is neither a presentation language nor
HTML has its own predefined a programming language.
tags. You can define tags according to your
In HTML, it is not necessary to need.
use a closing tag.
HTML is static because it is used XML makes it mandatory to use a
to display data. closing tag.
XML is dynamic because it is used to
transport data.
XII/PB/2021/CS/SET-1
26 a. HTTP-Hypertext transfer Protocol 2
b. POP3-Post office protocol ver. III
c. VOIP- Voice over internet Protocol
d. TCP- Transmission control protocol
27 Default argument in function- value provided in the formal arguments in the definition header
of a function is called as default argument in function. They should always be from right side
argument to the left in sequence. For example:
def func( a, b=2, c=5): # definition of function func( )
here b and c are default arguments 2
OR
In the function CalculateInterest (Principal, Rate=.06,Time) parameters should be default
parameters from right to left hence either Time should be provided with some default value or
default value of Rate should be removed
28 Rewrite the following Python program after removing all the syntactical errors (if any),
underlining each correction:
def checkval: # checkval( )
x = input("Enter a number") # int(input(“Enter a number”))
if x % 2 =0:
print (x, "is even")
elseif x<0: # elif
print (x, "should be positive")
else; # else:
print (x, "is odd")
29 Maximum value of FROM = 3
Maximum value of TO = 4 2
(ii) 30#40#50#
30 Primary Key- one or more attribute of a relation used to uniquely identify each and every tuple
in the relation. For Example : In the below Table Student, RollNo can be the Primary Key
RollNo Name Marks 2
1 Paridhi 90
2 Unnati 85
31 { } and fetchone() 2
32 DDL- Data definition language. Consists of commands used to modify the metadata of a
table. For Example- create table, alter table, drop table 2
DML-Data manipulation language. Consist of commands used to modify the data of a table.
For Example- insert, delete, update
33 vELCcME#Kk 2
Section-II
34 L=[10,12,14,17,10,12,15,24,27,24] 3
L1=[ ]
L2=[ ]
for i in L:
if i not in L2:
c=L.count(i)
L1.append(c)
L2.append(i)
print('Item','\t\t','frequency') XII/PB/2021/CS/SET-1
for i in range(len(L1)): 3
3
print(L2[i],'\t \t', L1[i]) 3
35 def COUNT_AND( ):
count=0
file=open(‘STORY.TXT','r')
line = file.read()
word = line.split()
for w in word:
if w in [‘AND’,’and’,’And’]:
count=count+1
file.close()
print(count)
(½ Mark for opening the file)
(½ Mark for reading word)
(½ Mark for checking condition)
(½ Mark for printing word)
OR
def DISPLAYWORDS( ):
count=0
file=open(‘STORY.TXT','r')
line = file.read()
word = line.split()
for w in word:
if w[0]=="T" or w[0]=="t":
count=count+1
file.close()
print(count)
(½ Mark for opening the file)
(½ Mark for reading word)
(½ Mark for checking condition)
(½ Mark for printing word)
36 i) ENGLISH 51
PHYSICS 76
MATHS 24
CHEMISTRY 27
ii) PRIYA RAI FEMALE
LISA ANAND FEMALE
iii) 4
(1 mark for each correct answer)
37 def stkpush(stk, item):
stk.append(item)
top=len(stk)-1
OR
def stkpop(stk):
if isEmpty( ):
print(“Underflow”)
XII/PB/2021/CS/SET-1 5
5
else:
item=stk.pop( ) 5
print(item)
if len(stk)==0:
top=None
else:
top=len(stk)-1
Section-III
38 (i) Any efficient layout with shortest Wire length
(ii) Between 3 and 4 due to larger distance
(iii) (a) Wireless
(b) WAN
(iv) Building-3 due to maximum no of Computers
(v) Co- axial cable or fiber optics
(1 mark for each correct answer)
39 i) update SCHOOL set PERIODS=0.9*PERIODS;
ii) select SCHOOL.TEACHERNAME, SCHOOL.CODE, ADMIN.DESIGNATION from
SCHOOL, ADMIN where gender=’MALE’.
iii) select SUBJECT, count(*) from SCHOOL group by SUBJECT;
iv) select * from SCHOOL where DOJ>’ 01/01/1999’ order by EXPERIENCE desc;
v) delete from SCHOOL where EXPERIENCE<10;
(1 mark for each correct answer)
40 def SCOUNT( ):
s=' '
count=0
with open('Names.dat', 'rb') as f:
while(s):
s = f.read(20)
s=s.decode( )
if len(s)!=0:
if s[0].lower()=='s':
count+=1
print('Total names beginning from "S" are ',count)
OR
import csv
def DISPEMP():
with open('emp.csv') as csvfile:
myreader = csv.reader(csvfile,delimiter=',')
print("%10s"%"EMPNO","%20s"%"EMP NAME","%10s"%"SALARY")
for row in myreader:
if int(row[2])>4000:
print("%10s"%row[0],"%20s"%row[1],"%10s"%row[2])
Common Pre-Board Examination Chandigarh Region 2020-21
Class: XII Sub: COMPUTER SCIENCE
Max. Marks: 70 Time: 3 HRS
Instructions to the Examinee:
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.
Questio Part A Marks
n No. 1
1
Section-I 1
1
Select the most appropriate option out of the options given for each
question. Attempt any 15 questions from question no 1 to 21.
1 Which of the following is valid arithmetic operator in Python:
(i) // (ii)? (iii) < (iv) and
2 Namethe PythonLibrarymoduleswhichneedto be imported to invokethe
following functions:
(i) sin( ) (ii) randint ( )
3 Which statement is used to retrieve the current position within the file?
a)fp.seek( ) b) fp.tell( ) c) fp.loc d) fp.pos
4 Which is the correct form of declaration of dictionary?
(i) Day={1:’monday’,2:’tuesday’,3:’wednesday’}
(ii) Day=(1;’monday’,2;’tuesday’,3;’wednesday’)
(iii) Day=[1:’monday’,2:’tuesday’,3:’wednesday’]
Page 1 of 10
(iv) Day={1’monday’,2’tuesday’,3’wednesday’]
5 Call the given function using KEYWORD ARGUMENT with values 100 and 1
200
def Swap(num1,num2):
num1,num2=num2,num1
print(num1,num2)
6 Function can alter only Mutable data types? (True/False) 1
7 How can you access a global variable inside the 1
function, if function has a variable with same name?
8 Stack is a data structure that follows__________ order 1
a) FIFO b) LIFO c)FILO d) LILO
9 If the following code is executed, what will be the output of the following code? 1
name="Computer Science with Python"
print(name[2:10])
10 Write down the status of Stack after each operation: 1
Stack = [10,20,30,40] where TOP item is 40
i) Pop an item from Stack
ii) Push 60
11 ---------------------- describe the maximum data transfer rate of a network or 1
Internet connection.
12 Expand : a) SMTP b) GSM 1
13 Mahesh wants to transfer data within a city at very high speed. Write the wired 1
transmission medium and type of network.
14 What is a Firewall in Computer Network? 1
A. The physical boundary of Network
B. An operating System of Computer Network
C. A system designed to prevent unauthorized access
D. A web browsing Software
15 A device used to connect dissimilar networks is called ........... 1
a) hub b) switch c) bridge d)gateway
16 Which command is used to see the structure of the table/relation. 1
a) view b) describe c) show d) select
17 A virtual table is called a ............. 1
18 Which clause is used to remove the duplicating rows of the table? 1
Page 2 of 10
i) or ii) distinct iii) any iv)unique
19 Which clause is used in query to place the condition on groups in MySql? 1
i) where ii) having iii) group by iv) none of the above
20 Which command is used for counting the number of rows in a database? 1
i) row ii) count iii) rowcount iv) row_count
21 A Resultset is an object that is returned when a cursor object is used to query a 1
table. True/False
SECTION - II
Both the Case study based questions are compulsory. Attempt any 4 sub
parts from each question. Each question carries 1 mark
22
Relation : Employee
id Name Designation Sal
101 Naresh Clerk 32000
102 Ajay Manager 42500
103 Manisha Clerk 31500
104 Komal Advisor 32150
105 Varun Manager 42000
106 NULL Clerk 32500
i. Identify the primary key in the table. 1
Write query for the following
ii. Find average salary in the table. 1
iii. Display number of records for each individual designation. 1
Page 3 of 10
iv. Display number of records along with sum of salaries for each individual 1
designation where number of records are more than 1.
v. What is the degree and cardinality of the relation Employee? 1
23 Anuj Kumar of class 12 is writing a program to create a CSV file “user.csv”
which will contain user name and password for some entries. He has written the
following code. As a programmer, help him to successfully execute the given
task.
import _____________ # Line 1
def addCsvFile(UserName,PassWord): # to write / add data into the CSV file
f=open(' user.csv','________') # Line 2
newFileWriter = csv.writer(f)
newFileWriter.writerow([UserName,PassWord])
f.close()
#csv file reading code
def readCsvFile(): # to read data from CSV file
with open(' user.csv','r') as newFile:
newFileReader = csv._________(newFile) # Line 3
for row in newFileReader:
print (row[0],row[1])
newFile.______________ # Line 4
addCsvFile(“Arjun”,”123@456”)
addCsvFile(“Arunima”,”aru@nima”)
addCsvFile(“Frieda”,”myname@FRD”)
readCsvFile() #Line 5
(a) Name the module he should import in Line 1. 1
(b) In which mode, Anuj should open the file to add data into the file 1
(c) Fill in the blank in Line 3 to read the data from a csv file. 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
Page 4 of 10
Part - B 2
Section - I 2
24 Evaluate the following expressions: 2
(i) not(20>6) or (19>7)and(20==20)
(ii) 17%20
25 What is Spam? How it affects the security of computer system?
Or
Differentiate between Bus Topology and Star Topology of Networks
26 What is default arguments in functions? Give Example.
Or
Differentiate between actual and formal arguments ? Explain with example.
27 Write the expanded names for the following abbreviated terms used in 2
Networking and Communications:
(i) CDMA (ii) HTTP (iii) XML (iv) URL
28 Rewrite the following code in python after removing all syntax error(s). 2
Underline each correction done in the code.
30=To
for K in range(0,To)
IF k%4==0:
print (K*4)
Else:
print (K+3)
29 Consider the following code: 2
import math
import random
print(str(int(math.pow(random.randint(2,4),2))),end= ' ')
print(str(int(math.pow(random.randint(2,4),2))),end= ' ')
print(str(int(math.pow(random.randint(2,4),2))))
What could be the possible outputs out of the given four choices?
i) 2 3 4 ii) 9 4 4 iii)16 16 16 iv)2 4 9
30 What do you understand by the term type conversion? Explain with suitable 2
example
Page 5 of 10
31 What is a cursor and how to create it in Python SQL connectivity? 2
32 What is Degree and Cardinality in relational table? 2
33 What will be the output of following code? 2
def display(s):
l = len(s)
m=""
for i in range(0,l):
if s[i].isupper():
m=m+s[i].lower()
elif s[i].isalpha():
m=m+s[i].upper()
elif s[i].isdigit():
m=m+"$"
else:
m=m+"*"
print(m)
display("[email protected]")
SECTION - II
34 Write a Python function to sum all the numbers in a list. 3
Sample List : [8, 2, 3, 0, 7]
Expected Output : 20
35 Write a function in python to read lines from file “POEM.txt” and display all 3
those words, which has two characters in it.
For e.g. if the content of file is
O Corona O Corona
Jaldi se tum Go na
Social Distancing ka palan karona
sabse 1 meter ki duri rakhona
Lockdown me ghar me ho to online padhai karona
O Corona O Corona Jaldi se tum Go na
Output should be : se Go na ka ki me me ho to se Go na
Page 6 of 10
Or
Write a function COUNT() in Python to read contents from file
“REPEATED.TXT”, to count and display the occurrence of the word
“Catholic” or “mother”.
For example:
If the content of the file is
“Nory was a Catholic because her mother was a Catholic, and Nory‟s
mother was a Catholic because her father was a Catholic, and her father
was a
Catholic because his mother was a Catholic , or had been
The function should display:
Count of Catholic, mother is 9
36 Write the outputs of the SQL queries (i) to (iii) based on the relation COURSE 3
(i) SELECT DISTINCT TID FROM COURSE;
(ii) SELECT TID, COUNT(*), MIN(FEES) FROM COURSE
GROUP BY TID HAVING COUNT(*)>1;
(iii) SELECT COUNT(*), SUM(FEES) FROM COURSE
WHERE STARTDATE< ‘2018-09-15’;
Write A Function Python, Make Push(Package) and Make Pop (Package) 3
37 to add a new Package and delete a Package form a List Package
Description, considering them to act as push and pop operations of the
Stack data structure.
Page 7 of 10
Or
Write InsQueue(Passenger) and DelQueue(Passenger) methods/function
in Python to add a new Passenger and delete a Passenger from a list
‘names’ , considering them to act as insert and delete operations of the
Queue data structure.
SECTION - III
38 Rehaana Medicos Center has set up its new center in Dubai. It has four 5
buildings as shown in the diagram given below:
Distances between various buildings are as follows:
Accounts to Research Lab 55 m
Accounts to Store 150 m
Store to Packaging Unit 160 m
Packaging Unit to Research Lab 60 m
Accounts to Packaging Unit 125 m
Store to Research Lab 180 m
No of Computers
Page 8 of 10
Accounts 25
Research Lab 100
Store 15
Packaging Unit 60
As a network expert, provide the best possible answer for the following
queries:
i) Suggest a cable layout of connections between the buildings.
ii) Suggest the most suitable place (i.e. buildings) to house the server of
this organization.
iii) Suggest the placement of the Repeater device with justification.
iv) Suggest a system (hardware/software) to prevent unauthorized access
to or from the network.
(v) Suggest the placement of the Hub/ Switch with justification.
39 Write SQL commands for the following queries (i) to (v) on the basis of relation 5
Mobile Master and Mobile Stock.
Page 9 of 10
(i) Display the Mobile Company, Name and Price in descending order
of their manufacturing date.
(ii) List the details of mobile whose name starts with “S” or ends with
“a”.
(iii) Display the Mobile supplier & quantity of all mobiles except
“MB003”.
(iv) List showing the name of mobile company having price between
3000 & 5000.
(v) Display M_Id and sum of Moble quantity in each M_Id.
40 5
1. Consider an employee data, Empcode, empname and salary. Write
python function to create binary file emp.dat and store their records.
2. write function to read and display all the records
Or
Consider a binary file emp.dat having records in the form of dictionary. E.g
{eno:1, name:”Rahul”, sal: 5000}
write a python function to display the records of above file for those employees
who get salary between 25000 and 30000
Page 10 of 10
COMMON PRE-BOARD EXAMINATION CHANDIGARH REGION 2020-21
CLASS: XII SUBJECT: INFORMATION PRACTICES (065)
MAX. MARKS: 70 TIME: 3 HRS.
MARKING SCHEME
PART-A
SECTION-I
Question No. 1-21 carries 1 mark each. Attempt any 15 questions from questions 1 to 21.
1 i.True
ii.False 1
½ mark for each correct answer
2 plt. xlabel () 1
1 mark for correct answer
3 80 1
1 mark for the correct answer
4 print(df.tail(4)) 1
1 mark for the correct usage of head()
5 20 1
1 mark for the correct answer.
6 Histogram 1
1 mark for the correct answer
7 Topology 1
1 mark for the correct answer
8 Row 1
1 mark for the correct answer
9 Graph 1
1 mark for the correct answer
10 Dynamic web page 1
1 mark for the correct answer
Page 1 of 7
11 Math Function 1
1 mark for the correct answer 1
1
12 Plagiarism 1
1 mark for the correct answer 1
1
13 head() 1
1 mark for the correct answer 1
1
14 Firewall 1
1 mark for the correct answer 1
15 c. Avast 1X4 =4
1 mark for the correct answer
16 Keystroke logging
1 mark for the correct answer
17 Cyberbullying
1 mark for the correct answer.
18 Desc / Describe.
1 mark for the correct answer
19 Use School;
1 mark for the correct answer
20 Switch
1 mark for the correct answer
21 Spam or spamming
1 mark for the correct answer
SECTION -II
Question No. 22, 23 carries2 mark each.
22 (i) SELECT * FROM Workers ORDER BY LASTNAME;
(ii) 1 mark for correct answer.
(iii) SELECT Designation, Min(salary) FROM Desig GROUP BY
Designation HAVING Designation IN (‘Manager’,’Clerk’);
(iv) 4
Page 2 of 7
1 marks each for correct query or output. (1/2)x8
23 ½ mark for each correct answer. =4
2
PART-B
SECTION-I 2
Question No. 24-33 carries 2 mark each.
24 1 mark for creating List of list . 2
1 mark for creating dataframe
½ mark should be deducted if Pandas not imported
25 Differences between single row functions and multiple row functions.
(i) Single row functions work on one row only whereas multiple
row functions group rows
(ii) Single row functions return one output per row whereas multiple
row functions return only one output for a specified group of rows.
Single row v/s Multiple row functions
1 mark for each valid point.
OR
The order by clause is used to show the contents of a table/relation in a
sorted manner with respect to the column mentioned after the order by
clause. The contents of the column can be arranged in ascending or
descending order.
The group by clause is used to group rows in a given column and then
apply an aggregate function eg max(), min() etc on the entire group.
(any other relevant answer)
Group by v/s Order by
1 mark for correct explanation
1 mark for appropriate example
26 i. select round(359.24);
ii. select round(39.24,-2);
1 mark each for correct answer of part (i) , (ii)
Page 3 of 7
27 import Pandas as pd 2
df=pd.DataFrame(Student,index=rollno) 2
df[‘age’].max()
1 mark each for correct answer of (i) , (ii) 2
28 This is because the column commission contains a NULL value and the 2
aggregate functions do not take into account NULL values. Thus
Command1 returns the total number of records in the table whereas
Command2 returns the total number of non NULL values in the column
commission.
29 a. select substr("Preoccupied", 4);
or
select substring("Preoccupied", 4);
or
select mid("Preoccupied",4);
or
select right(("Preoccupied"”, 8);
b. select substr("Preoccupied" ,3,3);
or
select substring("Preoccupied", 3,3);
or
select mid(("Preoccupied" ,3,3);
OR
a. select instr 'Preoccupied' , ‘ 'occ'));
b. select left 'Preoccupied',6);
1 mark for each correct answer of part (a) , (b)
30 (i) df1.loc[‘D’]=[18,19]
(ii) df1.drop(‘C2’, axis=1,Inplace=True)
1 mark for each correct answer
Page 4 of 7
31 a. SMTP: Simple Mail Transfer Protocol 2
b. VoIP: Voice over Internet Protocol 2
1 marks for each correct full form 2
3
32 The continuous use of devices like smartphones, computer desktop,
laptops, head phones etc cause a lot of health hazards if not addressed.
These are:
i. Impact on bones and joints: wrong posture or long hours of sitting in
an uncomfortable position can cause muscle or bone injury.
ii. Impact on hearing: using headphones or earphones for a prolonged time
and on high volume can cause hearing problems and in severe cases
hearing impairments.
iii. Impact on eyes: This is the most common form of health hazard as
prolonged hours of screen time can lead to extreme strain in the eyes.
iv. Sleep problem: Bright light from computer devices block a hormone
called melatonin which helps us sleep. Thus we can experience sleep
disorders leading to short sleep cycles.
2 marks for any two correct points
33 1 mark for correct definition. 1 mark for ways to manage e-waste.
SECTION -II
Question No. 34-37 carries 3 mark each.
34 0 10
1 20
2 30
3 40
Justification: In the first statement x represents a list so when a list is
multiplied by a number, it is replicated that many number of times.
The second y represents a series. When a series is multiplied by a value,
then each element of the series is multiplied by that number.
1 mark for output of list multiplication
Page 5 of 7
1 mark for output of Series multiplication 3
1 mark for the justification
35 1 marks for explaining cybercrime. 3
1 marks each for correct examples. 3
1 for explaining IT ACT.
OR
Net Etiquettes refers to the proper manners and behavior we need to
exhibit while being online.
These include :
1.No copyright violation: we should not use copyrighted materials
without the permission of the creator or owner. We should give proper
credit to owners/creators of open source content when using them.
2. Avoid cyber bullying: Avoid any insulting, degrading or intimidating
online behavior like repeated posting of rumors, giving threats online,
posting the victim’s personal information, or comments aimed to publicly
ridicule a victim.
Or any other relevant answer.
1 marks for definition of Net Etiquettes
1 marks each for the example with explanation.
36 ½ mark for importing matplotlib.pyplot.
½ mark for correct function for drawing function.
½ mark for xlabel()
½ mark for ylablel()
½ mark for title()
½ mark for show().
37 a. select Type, sum(Price) from Vehicle group by Type having
sum(Qty)>30;
b. select Company, count(distinct Type) from Vehicle group by Company;
c. Select Type, min(Price) from Vehicle group by Type;
Page 6 of 7
SECTION -III 2+2+1=5
Question No. 38-40 carries 5 mark each. 1X5=5
38 a. 1 marks each for correct definition. 1X5=5
b. 1 marks each for correct difference between SQL drop and delete
command.
c. 1 mark for correct answer.
39 i. 1 mark for correct difference between primary key and candidate key.
ii. 1 mark for correct answer
iii. Degree : 4 columns , Cardinality : 10.
iv. SQL is Database language and Mysql is Database Management
Software.
v. 1 mark for correct answer
40 i. broadband or any other correct answer.
ii. Optical fiber
iii. WAN
iv. cityB (having max computers)
v. Hacker
Page 7 of 7
KENDRIYA VIDYALAYA SANGATHAN, CHENNAI REGION
PRACTICE TEST 2020 – 21
CLASS XII
Max. Marks: 70 Subject: Computer Science (083) Time: 3 Hrs.
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 sub-parts. An examinee is to attempt any 4 out of the 5 subparts.
4. Part - B is Descriptive Paper and has 3 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.
5. 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 no 1 to
21.
1 Find the invalid identifier from the following 1
a) Subtotal b) assert c) temp_calc
d) Name2
2 Given the list Lst = [ 12, 34, 4, 56, 78, 22, 78, 89], find the output of 1
print(Lst[1:6:2]) 1
3 Which of the following functions do we use to write data in a binary file?
a) writer( ) b) output( ) c) dump( ) d) send( )
4 Which operator is used for replication? 1
a) + b) % c) * d) //
5 Give the output of the following code: 1
L = [ 1,2,3,4,5,6,7]
B=L
B[3:5] = 90,34
print(L)
1|Page