Nothing Special   »   [go: up one dir, main page]

Asss

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

NAVODAYA VIDYALAYA SAMITI, CHANDIGARH REGION

THIRD PRE BOARD EXAMINATION

Class: XII Session: 2020-21


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 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 c.tuple 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


“employees.csv” 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(' employees.csv',' ') # Line 2
writerObj = csv.writer(f)
writerObj.writerow([empName,empId])
f.close()

#csv file reading code


def readEmployees(): # to read data from CSV
with open(' employees.csv','r') as fobj:
readerObj = csv. (fobj) # Line 3
for row in readerObj:
print (row[0],row[1])
fobj.close() # 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 * Math.pow(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 “myfile.txt”.
Example: If the “myfile.txt” 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 “myfile.txt”, count the number of vowels and display the count.
Example: If the “myfile.txt” 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 = S.WATCHID GROUP BY
S.WATCHID;
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 “employees.dat” has structure [empid, empname, age, department]. 5
a. Write a user defined function CreateEmployee() to input the data to a
record and add to employee.dat
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 “students.dat” 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.

You might also like