0% found this document useful (0 votes)
49 views10 pages

SQP 26 - QP

The document is a question paper for the First Pre-Board Examination 2020-21 for Class XII in Computer Science. It consists of two parts: Part A with short answer and case study questions, and Part B with descriptive questions. The exam focuses on Python programming, SQL, and various computing concepts, with a total of 70 marks and a duration of 3 hours.

Uploaded by

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

SQP 26 - QP

The document is a question paper for the First Pre-Board Examination 2020-21 for Class XII in Computer Science. It consists of two parts: Part A with short answer and case study questions, and Part B with descriptive questions. The exam focuses on Python programming, SQL, and various computing concepts, with a total of 70 marks and a duration of 3 hours.

Uploaded by

yaaraanthapaiya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Kendriya Vidyalaya Sangathan, Tinsukia Region

First Pre-Board Examination 2020-21


Computer Science (083) (Theory)
Class: 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. 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 valid identifier from the following (1)
a) False b) Ist&2nd c) 2ndName d) My_Name
2. Given the lists L=[1,30,67,86,23,15,37,131,9232] , write the (1)
output of print(L[3:7])
3. Name all the file access modes in python. (1)
4. Identify the invalid logical operator in Python from the following. (1)
a) and b) or c) not d) Boolean
5. Suppose a tuple T is declared as T = (10, 12, 43, 39), which of the (1)
following is Incorrect?
a) print(T[1])

Page 1 of 9
b) print(max(T))
c) print(len(T))
d) None of the above
6. Write a statement in Python to declare a dictionary whose keys are 5, 8, (1)
10 and values are May, August and October respectively.
7. A list is declared as (1)
Lst = [1,2,3,4,5,6,8]
What will be the value of sum(Lst)?
8. Name the built-in function / method that is used to return the length of (1)
the object.
9. Name the protocol that is used to transfer files. (1)
10. Your friend’s mother receives an e-mail to access the additional services (1)
of bank at zero cost from some agency asking her to fill her bank details
like credit card number and PIN in the form attached to the mail.
Identify the type of cybercrime in this situation.
11. In SQL, name the clause that is used to display the unique values of an (1)
attribute of a table.
12. In SQL, what is the use of <> operator? (1)
13. Write any two aggregate function used in SQL. (1)
14. Which of the following is/ are DML command(s)? (1)
a) SELECT b) ALTER c) DROP d) UPDATE
15. Name the fastest available transmission media. (1)
16. Identify the valid declaration of L: (1)
L = (‘Mon’, ‘23’, ‘hello’, ’60.5’)
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="Computer_Science_with_Python"
print(name[-25:10])
18. In SQL, write the query to display the list databases. (1)
19. Write the expanded form of LAN & MAN. (1)
20. Which of the following types of table constraints will not prevent NULL (1)
entries in a table?
a) Unique
b) Distinct
c) Primary Key
d) NOT NULL
21. Rearrange the following transmission media in increasing order of data (1)
transfer rates.
UTP CAT - 5 , UTP CAT – 6, IR, Bluetooth, OFC
Section-II
Both the Case study based questions are compulsory. Attempt any 4
sub parts from each question. Each question carries 1 mark

Page 2 of 9
22. A local library OurLib is considering to maintain their inventory
using SQL to store the data. As a database administer, Nishita has
decided that :
• Name of the database - OurLib
• Name of the table - BOOKS
• The attributes of Table BOOKS are as follows:
Book_ID - numeric
Title – character of size 30
Author - character of size 20
Publisher – character of size 30
Price – Float

Book Title Author Publisher Price


_ID
The Leader who
1001 had no title Robin Sharma PHI 500
1002 You Can Win Shiv Kheda TMH 253
Rich Dad Poor Robert T.
1003 Dad Kiyosaki PHI 564
Success Through
a Positive Napoleon
1004 Mental Attitude Hill Penguin 522
Fear Not, Dream
1005 Big, & Execute Jeff Meyer MCH 845
Leadership: The
Art of Inspiring
People to Be Craig B.
1006 Their Best Whelden Penguin 542
a. Identify the attribute best suitable to be declared as a primary key. (1)
b. Write the degree and cardinality of the table BOOKS. (1)
c. Insert the following data into the table BOOKS. (1)
Book_ID= 2010, Title= “A Book of Comp. Sc.”, Author= “Praveen
Sharma” and Price = 625
d. Nishita want to remove the entire data of table BOOKS from the (1)
database OurLib.
Which command will he use from the following:
i. DELETE FROM BOOKS;
ii. DROP TABLE BOOKS;
iii. DROP DATABASE BOOKS;
iv. DELETE TABLE books FROM OurLib;
e. Now Nishita wants to display the structure of the table BOOKS, i.e. (1)
Title of the attributes and their respective data types that she
has used in the table. Write the query to display the same.

23. Sanjay Dalmia of class 12 is writing a program to create a CSV file


“contacts.csv” which will contain Name and Mobile Number for some

Page 3 of 9
entries. He has written the following code. As a programmer, help him to
successfully execute the given task.

import # Line 1

def addCsvFile(Name,Mobile): # to write / add data into the CSV file


f=open(' contacts.csv',' ') # Line 2
newFileWriter = csv.writer(f)
newFileWriter.writerow([Name,Mobile])
f.close()

#csv file reading code


def readCsvFile(): # to read data from CSV file
with open(' contacts.csv','r') as newFile:
newFileReader = csv. (newFile) # Line 3
for row in newFileReader:
print (row[0],row[1])
newFile. # Line 4
addCsvFile(“Arjun”,”8548587526”)
addCsvFile(“Arunima”,”6585425855”)
addCsvFile(“Frieda”,”8752556320”)

readCsvFile() #Line 5

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


b) In which mode, Sanjay 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)
Part – B
Section-I

24. Evaluate the following expressions: (2)


a) 8/4+4**2//5%2-8
b) 10 >= 5 and 7 < 12 or not 13 == 3
25. Differentiate between Switch and a Hub. (2)
OR
Differentiate between Web server and web browser. Write any two
popular web browsers.
26. Expand the following terms: (2)
a. URL b. Wi-Fi c. LAN d. GPRS
27. Differentiate between break and continue statements with a suitable (2)
example.

Page 4 of 9
OR
What is the difference between local and a global variable? Explain with
the help of a suitable example.
28. Rewrite the following code in Python after removing all syntax error(s). (2)
Underline each correction done in the code.
a = 200
b = 33
if b > a
Print("b is greater than a")
elseif a == b:
print(a and b are equal)
else:
print("a is greater than b")

29. What possible outputs(s) are expected to be displayed on screen at the (2)
time of execution of the program from the following code? Also
specify the maximum values that can be assigned to each of the
variables first, second and third.
from random import randint
LST=[5,10,15,20,25,30,35,40,45,50,60,70]
first = randint(3,8)
second = randint(4,9)
third = randint(6,11)
print(LST[first],"#", LST[second],"#", LST[third],"#")

(i) 20#25#25# (ii) 30#40#70# (iii) 15#60#70# (iv) 35#40#60#


30. What do you understand by Candidate Keys in a table? Give a suitable (2)
example of Candidate Keys from a table containing some meaningful
data.
31. Differentiate between fetchone() and fetchall() methods with suitable (2)
examples for each.
32. Write the full forms of DDL and DML. Write any two commands of (2)
DML in SQL.
33. Find and write the output of the following Python code: (2)
def change (P,Q=30):
P=P+Q
Q=Q-P
print(P,”#”,Q)
return(P)
R=150
S=100
R=change(R,S)
print(R,"#",S)
S=change(S)

Page 5 of 9
Section- II
34. Take the two lists, and write a program that returns a list only the (3)
elements that are common between both the lists (without duplicates) in
ascending order. Make sure your program works on two lists of different
sizes.

e.g.
L1= [1,1,2,3,5,8,13,21,34,55,89]
L2= [20,1,2,3,4,5,6,7,8,9,10,11,12,13]
The output should be:
[1,2,3,5,8,13]
35. (3)
Write a function in Python that counts the number of “The” or “This”
words present in a text file “MY_TEXT_FILE.TXT”.
Note: (The comparison should be case insensitive)

OR
Write a function VowelCount() in Python, which should read each
character of a text file MY_TEXT_FILE.TXT, should count and display
the occurrence of alphabets vowels.
Example:
If the file content is as follows:
Updated information
As simplified by official websites.
The VowelCount() function should display the output as:
A or a:4
E or e :4
I or I :8
O or o : 0
U or u: 1
36. Write the outputs of the SQL queries (i) to (iii) based on the relations (3)
Teacher and Posting given below:
Table: Stationary
S_ID StationaryName Company Price
DP01 Dot Pen ABC 10
PL02 Pencil XYZ 6
ER05 Eraser XYZ 7
PL01 Pencil CAM 5
GP02 Gel Pen ABC 15

Page 6 of 9
Table: Consumer
C_ID ConsumerName Address S_ID
1 Good Learner Delhi PL01
6 Write Well Mumbai GP02
12 Topper Delhi DP01
15 Write & Draw Delhi PL02

i. SELECT count(DISTINCT Address) FROM Consumer;


ii. SELECT Company, MAX(Price), MIN(Price), COUNT(*)
from Stationary GROUP BY Company;
iii. SELECT Consumer.ConsumerName,
Stationary.StationaryName, Stationary.Price
FROM Stationary, Consumer
WHERE Consumer.S_ID = Stationary.S_ID;
37. Write a function in Python PUSH (Lst), where Lst is a list of numbers. (3)
From this list push all numbers not divisible by 6 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(Lst), where Lst is a stack implemented by
a list of numbers. The function returns the value deleted from the stack.
Section-III
38. Laxmi Marketing Ltd. has four branches in its campus named Udaipur, (5)
Kota, Jodhpur and Ajmer. Laxmi Marketing Ltd. wants to establish the
networking between all the four offices. A rough layout of the same is as
follows:

Udaipur Jodhpur
Office Office

Ajmer Kota
Office Office

Approximate distances between these offices as per network survey team


are as follows:
Place From Place To Distance
Udaipur Jodhpur 30 m
Jodhpur Kota 40 m
Kota Ajmer 25 m
Udaipur Ajmer 150 m
Jodhpur Ajmer 105 m
Udaipur Kota 60 m

Page 7 of 9
In continuation of the above, the company experts have planned to install
the following number of computers in each of their offices:

Udaipur 40
Jodhpur 80
Kota 200
Ajmer 60
i. Suggest the most suitable place (i.e., Block/Center) to
install the server of this organization with a suitable reason.
ii. Suggest an ideal layout for connecting these blocks/centers
for a wired connectivity.
iii. Which device will you suggest to be placed/installed in
each of these offices to efficiently connect all the
computers within these offices?
iv. Suggest the placement of a Repeater in the network with
justification.
v. The organization is planning to connect its new office in
Delhi, which is more than 1250 km current location. Which
type of network out of LAN, MAN, or WAN will be
formed? Justify your answer.
39. Consider the tables given below. (5)
Table : STOCK
Itcode Itname Dcode Qty UnitPrc StkDate
444 Drawing Copy 101 10 21 31-June-2009
445 Sharpener Camlin 102 25 13 21-Apr-2010
450 Eraser Natraj 101 40 6 11-Dec-2010
452 Gel Pen Montex 103 80 10 03-Jan-2010
457 Geometry Box 101 65 65 15-Nov-2009
467 Parker Premium 102 40 109 27-Oct-2009
469 Office File 103 27 34 13-Sep-2010

Table : DEALERS
Dcode Dname Location
101 Vikash Stationers Lanka Varanasi
102 Bharat Drawing Emporium Luxa Varanasi
103 Banaras Books Corporation Bansphatak Varanasi

(i) To display all the information about items containing the word
“pen” in the field Itname in the table STOCK.
(ii) List all the itname sold by Vikash Stationers.
(iii) List all the Itname and StkDate in ascending order of StkDate.
(iv) List all the Itname, Qty and Dname for all the items for the items
quantity more than 40.
(v) List all the details of the items for which UnitPrc is more than 10
and <= 50.
40. A binary file “Employee.dat” has structure [Emp_ID, Emp_Name, Salary, (5)
Mobile].

Page 8 of 9
i. Write a user defined function CreateFile() to input data for a record and
add to Employee.dat .
ii. Write a function TotalSalary() in Python which return the sum of
salary of all the employees stored in the binary file “Employee.dat”

OR
A binary file “Account.dat” has structure (Acct_Number, Acct_Type,
AcctHolderName, Balance).
i. Write a user defined function CreateFile() to input data for a record
and add to Account.dat .
ii. Write a function CountBalanceAbove(BAL) in Python that would
read contents of the file “Account.dat” and display the details of
those accounts in which Balance is more than BAL. Also display
number of such accounts.

******************************* END*******************************

Page 9 of 9

You might also like