0% found this document useful (0 votes)
7 views17 pages

KVS Class XII Computer Science Sample Paper

This document is a sample question paper for Class XII Computer Science (083) for the academic session 2020-21 in the Jammu region. It consists of two parts: Part A, which includes short answer questions and case studies, and Part B, which is a descriptive paper with various sections. The paper covers topics such as Python programming, SQL, and data communication, with a total of 70 marks and a time allowance of 3 hours.

Uploaded by

t9zfx
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views17 pages

KVS Class XII Computer Science Sample Paper

This document is a sample question paper for Class XII Computer Science (083) for the academic session 2020-21 in the Jammu region. It consists of two parts: Part A, which includes short answer questions and case studies, and Part B, which is a descriptive paper with various sections. The paper covers topics such as Python programming, SQL, and data communication, with a total of 70 marks and a time allowance of 3 hours.

Uploaded by

t9zfx
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

KVS JAMMU REGION

Class: XII Session: 2020-21


Computer Science (083)
Sample Paper -1 (Theory)
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 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 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

Question Part-A Marks


No. allocated
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) my%name b) myage c) _name_ d) students1

2 Given the lists L=[“H”, “T”, “W”, “P”, “N”] , write the output of print(L[1:4]) 1

3 Which module is required to work with CSV files in Python? 1


4 Identify the invalid relational operator in Python from the following. 1
a) = = b) < c) =< d) <=
5 Suppose a tuple T is declared as T = (10, 12, 43, 39), which of the following is 1
incorrect?
a) print(T[-2])
b) T[0] = 45
c) print(min(T))
d) print(max(T))

6 Write a statement in Python to declare a dictionary whose keys are a,b,c 1


and values are January, February and March respectively.

7 A List is declared as 1
L = [2,5,6,9,8]
What will be the value of len(L)?

8 Name the built-in mathematical function / method that is used to return 1


the smallest integer greater than or equal to x.

9 Name the protocol that is used to send files over a Network. 1

10 Your friend Sridhar complains that somebody has created is continuously 1


sending him mails claiming that Sridhar has won Rs. 1 crore and has to
submit his account details. Identify the type of cybercrime for these
situations.
11 In SQL, name the clause that is used to display the tuples in descending order 1
of an attribute.

12 In SQL, what is the use of NOT NULL operator? 1

13 Write any one aggregate function used in SQL. 1

14 Which of the following is a DML command? 1


a) SELECT b) ALTER c) CREATE d) DROP

15 Name the transmission media best suitable for connecting to islands like 1
Andaman & Nicobar from Chennai.
16 Identify the data type of T: 1
T = [‘A’, ‘23’, ‘92’, ‘(10,20)’]
a. dictionary b. string [Link] d. list
17 If the following code is executed, what will be the output of the 1
following code?
name="Kendriya Vidyalaya Sangathan"
print(name[2:13:2])

18 In SQL, write the query to display the structure of tables stored in a database. 1

19 Write the expanded form of POP3 protocol. 1

20 Which of the following types of table constraints will prevent the printing 1
of duplicate values after the Select statement fetches data from table?
a) Unique
b) Distinct
c) Primary Key
d) NULL

21 Rearrange the following terms in decreasing order of data transfer rates. 1


Gbps, Mbps, Pbps, bps
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 medical store Rajshree is considering to maintain their inventory using


SQL to store the data. As a database administer, Sahil has decided that :
 Name of the database - rajshree
 Name of the table - medicalstore
 The attributes of medicalstore are as:

MedicineNo - numeric
MedicineName – character of size 25
MedCode – numeric
Quantity – numeric
Table : medicalstore
MedicineNo MedicineName MedCode Quantity
5647 Saridon 141 75
5741 Paracetamol 142 44
3546 Nicip Plus 141 60
9541 Disprin 140 53
2025 Diclofenac 143 73
2783 Corex Syrup 141 97
8614 Psorid 142 48
(a) Identify the attribute best suitable to be declared as a primary key, 1
(b) Write the degree and cardinality of the table medicalstore. 1

(c) Insert the following data into the attributes respectively in the given 1
table medicalstore.
MedicineNo = 6647, MedicineName = “Dapsone”, MedCode = 141 and
Quantity = 55
(d) Sahil want to remove the table medicalstore from the database 1
rajshree. Which command will he use from the following:
a) DELETE FROM rajshree;
b) DROP TABLE medicalstore;
c) DROP DATABASE medicalstore;
d) DELETE medicalstore FROM rajshree;

(e) Now Sahil wants to know the Primary key of the table along with data 1
types of all the columns. Which query should he write?

23 Rajat Kumar of Class 12 is writing a program to create a CSV file


“[Link]” which will contain employee name and employee ID for
some entries. He has written the following code. As a programmer, help him
to successfully execute the given task.

import # Line 1

def addEmployee(empName,empId): # to write / add data into the CSV


f=open(' [Link]',' ') # Line 2
writerObj = [Link](f)
[Link]([empName,empId])
[Link]()

#csv file reading code


def readEmployees(): # to read data from CSV
with open(' [Link]','r') as fobj:
readerObj = csv. (fobj) # Line
3 for row in readerObj:
print (row[0],row[1])
[Link]() # Line 4

addEmployee (“Ram”, “2541”)


addEmployee(“Jagat”,”5471”)
addEmployee(“Fido”,”5418”)
readEmployees () #Line 5

(a) What should be written in Line 1. 1


(b)Which mode should Rajat write in Line-2 1
(c) Fill in the blank in Line 3 to read the data from a csv file. 1
(d) Which of the above mentioned lines is a redundant line? 1
(e) Write the output he will obtain while executing Line 5. 1
Part – B
Section-I
24 Evaluate the following expressions: 2
a) 8/2 + 2**5 – 5/2 + 7
b) 17 >= 6 and 3 > 11 or not 24 < 3

25 Differentiate between Viruses and Trojan Horse in context of networking and 2


data communication threats.
OR
Differentiate between Client Software and Web Browsers. Write any two
popular web browsers.
26 Expand the following terms: 2
a. FTP b. XML c. MAN d. WAN
27 Differentiate between default parameter(s) and keyword parameter(s) with 2
a suitable example for each.
OR
Explain the concept of Scope in functions with suitable Example.

28 Rewrite the following code in Python after removing all syntax 2


error(s). Underline each correction done in the code.
Def myfun():
r = raw-input(‘enter any radius : ’)
a = pi * [Link](r,2)
Print (“Area = ”, a)
29 What possible outputs(s) are expected to be displayed on screen at the time 2
of execution of the program from the following code?

import random
x=3
N = random, randint (1, x)
for i in range (N):
print(i, ‘#’, i + i)

a. What is the minimum and maximum number of times the loop will execute?
b. Find out, which line of output(s) out of (i) to (iv) will not be expected from
the program?
i. 0#1
ii. 1#2
iii. 2#3
iv. 3#4

30 What do you understand by Foreign Keys in a table? Give a suitable example of 2


Foreign Keys from a table containing some meaningful data.

31 2
Differentiate between DELETE and DROP commands in SQL?

32 Write the full forms of DDL and DML. Write any two commands of DDL in 2
SQL.
33 Find and write the output of the following Python code: 2

def myfun():
n = 50
i=5
s=0
while i<n:
s+ = i
i+ = 10
print(“sum”, s)

myfun()
Section- II

34 Rewrite the following while loop into for loop and also tell its output: 3
i = 10
while i<250:
print(i)
i = i+50
35 Write a function in Python that counts the number of “the” or “this” words 3
present in a text file “[Link]”.
Example: If the “[Link]” contents are as follows:
This is my first class on Computer Science. File handling is the easiest topic for
me and Computer Networking is the most interesting one.
The output of the function should be: Count of the/this in file: 3

OR
Write a function countVowels() in Python, which should read each character of a
text file “[Link]”, count the number of vowels and display the count.
Example: If the “[Link]” contents are as follows:
This is my first class on Computer Science.
The output of the function should be: Count of vowels in file: 10
36 Write the outputs of the SQL queries (i) to (iii) based on the given tables: 3
Watches
Watchid Watch_name Price Type Qty_store
W001 High Time 10000 Ladies 100
W002 Life Time 15000 Gents 150
W003 Wave 12500 Ladies 200
W004 High Fashion 13500 Ladies 135
W005 Golden Time 14000 Unisex 150

Sale
Watchid Qty_sold Quarter
W001 10 1
W002 8 2
W003 15 1
W001 12 3
W003 11 2
W004 9 1
W002 15 1

i. SELECT MAX (PRICE), MIN(QTY_STORE) FROM WATCHES;


ii. SELECT QUARTER, SUM(QTY SOLD) FROM SALE GROUP BY
QUARTER;
iii. SELECT WATCH_NAME, QTY_STORE, SUM (QTY_SOLD) FROM
WATCHES W, SALE S WHERE W. WATCHID = [Link] GROUP BY
[Link];

37 Write a function in Python Push(Arr, value), where Arr is a list of Strings. From 3
this list push all the Strings starting with “a” or “g 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 should return the value deleted from the Stack only if it is a
multiple of 6.
Section-III
38 Freshminds University of India is starting its first campus Anna Nagar of South 5
India with its centre admission office in Kolkata. The university has three major
blocks comprising of Office Block, Science Block and Commerce Block in the 5
km area campus.
As a network expert, you need to suggest the network plan as per (a) to (e) to the
authorities keeping in mind the distance and other given parameters.
Expected wire distances between various locations:
Office block to Science block 90m
Office block to Commerce block 80m
Science block to Commerce block 15m
Kolkata Admission Office to Anna 2450m
Nagar Campus

Expected number of computers to installed at various locations in the university


are as follows:
Office block 10
Science Block 140
Commerce Block 30
Kolkata Admission Office 8

a. Suggest the authorities, the cable layout amongst various blocks inside
university campus for connecting the blocks
b. Suggest the most suitable place (i.e. block) to house the server of this
university with a suitable reason
c. Suggest an efficient device from the following to be installed in each of the
blocks to connect all the computers
d. Suggest the placement of a Repeater (if any) in the network with
justification.
e. Suggest the most suitable (very high speed) service to provide data
connectivity between Admission Office located in Anna Nagar and
Kolkata Admission Office

39 Write the SQL commands for the following queries (a) to (e) on the basis of the 5
following tables SHOP and ACCESSORIES.

Table: SHOP
ID Sname Area
S01 ABC Computronics CP
S02 All Infotech GK II
S03 Tech Shop CP
S04 Geeks Techno Soft Nehru Place
S05 Hitech Tech Store Nehru Place

Table: ACCESSORIES
No Name Price ID
A01 Mother Board 12000 S01
A02 Hard Disk 5000 S01
A03 Keyboard 500 S02
A04 Mouse 300 S01
A05 Mother Board 13000 S02
A06 Keyboard 400 S03
A07 LCD 6000 S04
T08 LCD 5500 S05
T09 Mouse 350 S05
T10 Hard Disk 4500 S03

a. To display Name and Price of all the Accessories in ascending order of


their Price.
b. To display Id and SName of all Shop located in Nehru Place.
c. To display Minimum and Maximum Price of each Name of Accessories
d. To display Name, Price of All Accessories and their respective Sname
where they are available.
e. To display all the items Name and Price having price range between 5000
to 12000 (both inclusive)
40 A binary file “[Link]” has structure [empid, empname, age, department]. 5
a. Write a user defined function CreateEmployee() to input the data to a
record and add to [Link]
b. Write a function CountRec(department) in Python which accepts the
Department of the employee as the parameter and count and return the
number of employees in that department.

OR

A binary file “[Link]” has structure (admission_number, Name, Percentage,


subject). Write a function countrec() in Python that would read contents of the file
and display the details of those students whose subject is “Biology” and
percentage is below 45%. Also display the number of such students.

KVS Jammu Region

Pre-Boards Paper - 2021


Computer Science – 083
MARKING SCHEME
Maximum Marks: 70 Time Allowed: 3 hours
Part – A
Section - I
1 a) my%name 1
2 [“T”, “W”, “P”] 1
3 Module “csv” 1
4 c) =< 1
5 b) T[0] = 45 (as tuple is immutable) 1
6 {“a” : “January” , “b” : “February” , “c”: “March”} 1
7 5
8 ceil() from math module 1
9 FTP (File Transfer Protocol) 1
10 Phishing 1
11 ORDER BY DESC 1
12 To check if the column does not have any Null/undefined value 1
13 SUM / AVG / COUNT / MAX / MIN (anyone of them) 1
14 a) SELECT 1
15 Microwave / Radio wave 1
16 d. List 1
17 “ediaVd” 1
18 DESC <tableName> 1
19 Post Office Protocol-3 1
20 (b) DISTINCT 1
21 Pbps, Gbps, Mbps , Bps 1
Part – A
Section - II
22 (a) MedicineNo 1
(b) Degree = 4 Cardinality = 7 1
(c) INSERT INTO medicalstore (MedicineNo, MedicineName, MedCode,Quantity) 1
VALUES(6647, “Dapsone”, 141,55);
1
(d) DROP TABLE medicalstore;
1
(e) DESCRIBE medicalstore;
23 (a) Line 1 : import csv 1
(b) Line 2 : f=open(' [Link]','a') 1
(c) Line 3 : readerObj = [Link](fobj) 1
(d) Line 4 : as we have opened the file in “with” operator, it closes itself 1
(e) Line 5 Output: 1
Ram 2541
Jagat 5471
Fido 5418
Part – B
24 a) 40.5 1
1
b) True
25 Virus is a computer program or software that connect itself to another software or computer 2
program to harm computer system. When the computer program runs attached with virus it
perform some action such as deleting a file from the computer system. Virus can’t be controlled
by remote.
Trojan Horse does not replicate itself like virus and worms. It is a hidden piece of code which
steal the important information of user. For example, Trojan horse software observe the e-mail ID
and password while entering in web browser for logging.
OR
Web Browser : A web browser is a software application for accessing information on the World
Wide Web. When a user requests a web page from a particular website, the web browser retrieves
the necessary content from a web server and then displays the page on the user's device.
Client software is a specific application that’s installed on our computer, that can be used to
communicate to some other piece of software over a network (such as the internet’s world wide
web). However, a client software doesn't necessarily need a network connection to run on your
computer.
Popular web browsers : Google Chrome, Mozilla Firefox, Internet Explorer etc
26 a. FTP - File Transfer Protocol 2
b. XML - eXtensible Markup Language
c. MAN – Metropolitan Area Network
d. WAN – Wide Area Network
27 Default arguments are the arguments where we provide a Default value to any parameter while 2
defining the function. Even if the value of that parameter is not passed while calling the function,
Python will take the default value for further processing otherwise it will take the passed value.
Ex:
def greet(name, msg="Good morning!"):
#body of function
In keyword arguments, we call a function with some values and these values get assigned to the
arguments according to their position, irrespecive of their positions in the function definition.
Ex:
def greet(name, msg="Good morning!"):
#body of function
greet(msg = “Hello”, name= “Sandeep”) #function called here
OR
A variable is only available from inside the region it is created. This is called scope. A variable
created inside a function belongs to the local scope of that function, and can only be used inside
that function. A variable created in the main body of the Python code is a global variable and
belongs to the global scope. Global variables are available from within any scope, global and local.
28 CORRECTED CODE: 2
Def myfun():
r = raw_input(‘enter any radius : ’)
a = pi * [Link](r,2)
print (“Area = ”, a)

29 OUTPUT: (ii) 2
a. Minimum Number = 1
Maximum number = 3
b. Option (iv)
30 When we create two tables that are related to each other, they are often related by a column 2
in one table referencing the primary key of the other table - that column is called the
"foreign key". Ex: consider following table Track, where artistid is a foreign key.
trackid title artistid
1 Great Big Words 1
1 This Pretty Planet 1
2 Cat's in the Cradle 2

31 DELETE command is used to remove information from a particular row or rows. If used without 2
condition, it will delete all row information but not the structure of the table. It is a DML
command.
DROP table command is used to remove the entire structure of the table and information. It is a
DDL command.

32 DDL – Data Definition Language 2


DML – Data Manipulation Language
Any two out of CREATE, DROP, ALTER
33 OUTPUT : sum= 125 2

34 for i in range(10, 250, 50): 3


print(i)

Output:
10
60
110
160
210

35 def displayTheThis(): 3
num=0
f=open("[Link]","r")
N=[Link]()
M=[Link]()
for x in M:
if x=="the" or x== "this":
print(x)
num=num+1
[Link]()
print("Count of the/this in file:",num)
OR
def countVowels():
fobj = open(“[Link]”)
data = [Link]()
count = 0
for ch in data:
if ch == “a” or ch == “e” or ch == “i” or ch == “o” or ch == “u”:
count +=1
print(“Count of vowels in file:”, count)
Note : Using of any correct code giving the same result is also accepted.

36 [Link](Price) = 15000, Min(Price) = 10000 3


ii.
QUARTER SUM(QTY_SOLD)
1 49
2 19
3 12

iii.
WATCH_NAME QTY_STORE QTY_SOLD
High Time 100 22
Life Time 150 23
Wave 200 26
High Fashion 135 9
Golden Time 150 NULL
37 Answer: (Using of any correct code giving the same result is accepted.)
3
def Push(Arr, value):
s =[]
for x in range(0,len(Arr)):
if Arr[x]== “a” or Arr[x] == “g”:
[Link](Arr[x])
if len(s) == 0:
print(“Stack is empty!!”)
else:
print(s)

OR

def Pop(Arr):
if len(s) == 0:
print(“Stack underflow”)
return
else:
L = len(Arr)
Val = Arr[-1]
if Val%6 ==0:
print(Val+5)
x = [Link](Val)
return x
38 a. Using Star Topology: 5

b. The most suitable place (i.e. block) to house the server of this university is Science
Block, because in this block there are maximum number of computer.
c. The efficient device to be installed in each of the blocks to connect all the computers is
switch.
d. No Repeater is required as distance is less than 100m at which the signal starts to weaken
in an Ethernet Cable/ Twisted Pair Cable.
e. For very high-speed connectivity between Admission office located in Kolkata and the
campus office in Anna Nagar is Satellite connection

39 a. SELECT Name, Price FROM ACCESSORIES ORDER BY Price Asc; 5


b. SELECT ID SName FROM SHOP WHERE Area=”Nehru Place”;
c. SELECT Name, max (Price); min(Price) FROM ACCESSORIES, Group By Name;
d. SELECT Name,Price, Sname
FROM ACCESSORIES, SHOP
WHERE [Link]=[Link];
e. SELECT Name, Price
FROM ACCESSORIES
WHERE Price BETWEEN 5000 and 12000;
40 import pickle 5
def CreateEmployee():
fobj = open(“[Link]”, “ab”)
empid = input(“Enter employee ID: “)
empname = input(“Enter employee name: “)
age = int(input(“Enter employee age: “))
department = int(input(“Enter employee department: “))
record = [empid, empname, age, department]
[Link](record, fobj)
[Link]()

def CountRec(department):
fobj = open(“[Link]”, “rb”)
count = 0
try:
while True:
record = [Link](fobj)
if department == record[3]:
count = count + 1
except:
[Link]()
return count

OR
import pickle
def countrec():
fobj = open(“[Link]”, “rb”)
count = 0
try:
while True:
record = [Link](fobj)
if record[2] < 45 and record[3] == “Biology”:
print(record[0], record[1], record[2], sep=”\t”)
count +=1
except:
[Link]()
return count

You might also like