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

BAL BHARATI PUBLIC SCHOOL

SAMPLE PAPER – 2020-21


COMPUTER SCIENCE THEORY (083) / XII

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.
4. Part - B is Descriptive Paper.
5. Part- B has three sections
a. Section-I is short answer questions of 2 marks each.
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.
6. All programming questions are to be answered using Python Language only

Question Part-A Marks


No. allocated
Section- I (15 marks)
1 Find the output of following : 1
(i)12&10 (ii) 7^13
2 Which of the following will create a list? 1
a) l1=list() b) l1=() c) l1=[1,2]
3 What will be the output of the expression: 3-10**2+99/11 1

4 Identify the invalid logical operator in Python from the following. 1


a) and b) or c) not d) nor
5 1
What will be the output produced by the following code?
T=(‘in’,’ur’)
T1=range(len(T))
For i in T1:
T[i]=T[i].upper()
Page 1 of 7
print(T)

6 Write a statement in Python to declare a function COMPUTE that 1


takes an integer as an argument and returns the square of it.

7 Predict the output of the code: 1


a = "Pre Board Paper 2020"
a = a.split()
b = a[0][0] + ". " + a[1][4] + ". " + a[3]
print (b)

8 Write the infix expression for: 1


10,3,*,7,1,-,*,23,+
9 Which command is used for finding the IP address and default gateway 1
of your network?
10 Your friend Ranjana complaints that somebody has created a fake 1
profile on Facebook and defaming her character with abusive comments
and pictures. Identify the type of cybercrime for these situations.
11 Which command in SQL is used to remove tuples from a relation? 1

12 The pattern ‘- - -‘ matches any string of _______ three characters and 1


‘- - - %’ matches any string of _______three characters.

13 Which clause in SQL provides summarizing results from a table? Write its 1
syntax also.
14 1
What is selection and projection operation used for?

15 Why is a switch used in place of hub in a network? State two reasons. 1

Section-II
Both the case study based questions are compulsory. Attempt any 4 sub parts from each
question. Each question carries 1 mark (8 marks)

16. RWA of Shalimar Bagh plans to start their society library. They plan to 1
maintain their inventory using SQL to store the data. They hire a
database administer, Shresth who does the planning for their library
automation. He decides that :
• Name of the database - RWALIB
• Name of the table - LIBRARY
• The attributes of LIBRARY are as follows:
 Code - character of size 5
 BookName – character of size 25
 Type - character of size 20
 Author – character of size 30
a) Write the statement to create the table as per the specifications
given above.
b) Identify the attribute best suitable to be declared as a primary key. 1

Page 2 of 7
c) Insert the following data into the attributes Code, BookName and 1
Type respectively in the given table LIBRARY.

Code = FL201, Bookname = “The adventures of TINTIN” , Type=


‘Adventure’
d) Shresth wants to display the structure of the table LIBRARY, 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.
e) If 10 rows are added in the table and 2 are deleted. What would be
the degree and cardinality of the relation LIBRARY?

17. Naman Kumar of class 12 is writing a program to create a binary file


“user.dat” which will contain name and percentage for some entries.
He has written the following code to display the entries with
percentage more than 75. As a programmer, help him to successfully
execute the given task.

import # Line 1

def add(UserName,per):
# to write / add data into the binary file
f=open(' user.dat,' ') # Line 2
stu=_________________ # Line 3
for i in stu:
if________________: # Line 4
print(i)
____________ # Line 5

(a) Name the module he should import in Line 1. 1


(b) In which mode, Naman should open the file to read data from the 1
file.
(c) Fill in the blank in Line 3 to read the data from the file. 1
(d) Fill in the blank in Line 4 to check the percentage criteria (>75) 1
(e) Fill in the blank to close the file. 1
Part – B
Section-I (20 marks)
18. Write 2 points of difference between Viruses and Worms in context of 2
networking and data communication threats.
19. Rewrite the following code in python after removing all syntax error(s). 2
Underline each correction done in the code.
1=i
J=1
While I<=5
While j <=2 :
Prent(I*J end=” ‘)
J+1=J
Print()
I=I+1
Page 3 of 7
20. Write 2 points of difference between local and global variable. Also, 2
support your answer with appropriate example.
21. Match most suitable pairs 2
a) FTP - A very high speed Internet service
b) 5G - A mobile communication system
c) HTTPS - Used for file upload on server
d) GSM - A secure communication protocol

22. Write a function in Python THREESQUARE(A,B,C) that accept 3 integer 2


values and it will return a tuple of square of 3 integer.

For example is user provide 3, 5, 8 then the function should return


(9,25,64) as return values .

23. Define Primary key and foreign key with help of an example. 2
24. Predict the output of the code given below: 2
def run(s):
k=len(s) m=” “
for i in range(0, k):
if (s[i].islower()) :
m = m + s[i].upper() elif
(s[i].isalpha()):
m = m + s[i].lower()
else:
m = m + ‘aa’
print(m) run(‘sCHOOL2@Com’)

25. Differentiate between cursor.execute() () and cursor.close() methods with 2


suitable examples for each.
26. Write a program in Python to accept a string and print the count of 2
uppercase and lowercase characters in the string.
27. State the use of csv.DictWriter() and csvwriter() function with example. 2
Section – II (12 marks)
28. Define a function name countto that reads a existing file named 3
“tofile.txt” and count numbers of all “to” or “TO”.
29. Write a function Shift(Arr,n) in Python, which accepts a list Arr of numbers 3
and n is the number of elements of the list and shifts the negative elements
to left and positive elements to right.

30. Write the outputs of the SQL queries (i) to (iii) based on the relations 3
Worker and Paylevel given below:

Page 4 of 7
Table: WORKER
ECODE NAME DESIG PLEVEL DOJ DOB
11 Sachin Supervisor P001 13-Sep- 2004 23-Aug-1985
Patel
12 Chander Operator P003 22-Feb-2010 12-Jul-1987
Nath
13 Fizza Operator P003 14-Jun-2009 14-0ct-1983
15 Ameen Mechanic P002 21-Aug-2006 13-Mar-1984
Ahmed
18 Sanya Clerk P002 19-Dec-2005 09-Jun-1983

Table: PAYLEVEL

PLEVEL PAY ALLOWANCE


P001 26000 12000
P002 22000 10000
P003 12000 6000
(i)
SELECT COUNT (PLEVEL), PLEVEL FROM WORKER GROUP BY PLEVEL
(ii) SELECT MAX (DOB), MIN (DOJ) FROM WORKER
(iii) SELECT NAME, DOJ, DOB FROM WORKER ORDER BY DOJ;

31. Write a function in Python PUSH(Arr), where Arr is a list of numbers. From 3
this list push all numbers divisible by 5 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(Arr), where Arr is a stack implemented by a
list of numbers. The function returns the value deleted from the stack.

Section – III (15 marks)


32. Symphony School has set up its new Branch at Agra for its office and web- 5
based activities. It has 4 Wings of buildings as shown in the diagram:

Admin Training

Transport Academic

Distance between the centres

Admin to Training 50 m
Training to Academic 70 m
Page 5 of 7
Academic to Admin 125 m
Training to Transport 80 m
Admin to Transport 175 m
Academic to Transport 90 m

Number of computers
Academic 50
Training 30
Admin 150
Transport 15

(i) Suggest the most suitable connection between the Wings and
topology.
(ii) Suggest the most suitable place (i.e., Wing) to house the server of this
organization with a suitable reason, with justification.
(iii) Suggest the placement of the following devices with justification:
(a) Repeater
(b) Hub/Switch
(iv) The organization is planning to link its head office situated in Delhi with
the offices at Agra. Suggest an economic way to connect it; the company is
ready to compromise on the speed of connectivity. Justify your answer.
(v) Name the device to be installed to avoid any unauthorized access to the
data in network.
33. A binary file “STUDENT.DAT” has structure (admission_number, Name, 5
Percentage). Write a function countrec() in Python that would read
contents of the file “STUDENT.DAT” and display the details of those
students whose percentage is above 75. Also display number of students
scoring above 75%

Page 6 of 7
34. Write SQL queries for (i) to (iii) and output for SQL queries (iv) to (v), 5
which are based on the table: STUDENT given below:

(i) To display Name, Class and total number of students who have
secured more than 450 marks, class wise.
(ii) To increase marks of all students by 20 whose class is “XII”
(iii) SELECT COUNT(*), City FROM STUDENT GROUP BY CITY HAVING
COUNT(*)>1;
(iv) SELECT MAX(DOB),MIN(DOB) FROM STUDENT;
(v) SELECT NAME,GENDER FROM STUDENT WHERE CITY=”Delhi”;

Page 7 of 7

You might also like