0% found this document useful (0 votes)
7 views

5-1 (2)

This document is a sample question paper for Class XII Computer Science (subject code 083) for the academic year 2022-23, consisting of five sections with various types of questions including multiple choice, short answer, and programming tasks. The paper covers topics such as Python programming, SQL commands, and computer networking, and includes specific instructions for each section. The maximum marks for the paper are 70, and it is designed to be completed in 3 hours.

Uploaded by

Gaming Vishal
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)
7 views

5-1 (2)

This document is a sample question paper for Class XII Computer Science (subject code 083) for the academic year 2022-23, consisting of five sections with various types of questions including multiple choice, short answer, and programming tasks. The paper covers topics such as Python programming, SQL commands, and computer networking, and includes specific instructions for each section. The maximum marks for the paper are 70, and it is designed to be completed in 3 hours.

Uploaded by

Gaming Vishal
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

SAMPLE QUESTION PAPER – 5 (2022-23)

CLASS- XII
SUB : COMPUTER SC(083)
Time Allowed: 3 Hours Maximum Marks :70

General Instructions :
1. Thisquestionpapercontainsfivesections,SectionAtoE.
2. Allquestionsarecompulsory.
3. SectionAhave18questionscarrying01markeach.
4. SectionBhas07VeryShortAnswertypequestionscarrying02markseach.
5. SectionChas05ShortAnswertypequestionscarrying03markseach.
6. SectionDhas03LongAnswertypequestionscarrying05markseach.
7. SectionEhas02questionscarrying04markseach.Oneinternalchoiceisgivenin
Q35against partc only.
8. AllprogrammingquestionsaretobeansweredusingPythonLanguageonly.

SECTION–A

1. Find the valid identifier from the following. 1


a) Tax+Payer b) 21st c) _tax d) for
2. WhichofthefollowingisavaliddatatypeinPython? 1
(a)number (b)None (c) Decimal (d) Character

3. Giventhefollowingdictionaries 1

dict_exam={"Exam":"SSCE",
"Year":2023}dict_result={"Total":600,"Pass_Marks":198}

Whichstatementwillmergethecontentsofbothdictionaries?
a. dict_exam.update(dict_result)
b. dict_exam+dict_result
c. dict_exam.add(dict_result)
d. dict_exam.merge(dict_result)

CS SP - XII / 2022-23 Page 1 of 9


4. Considerthegivenexpression: 1
not True or False and False
Whichofthefollowingwillbecorrectoutputifthegivenexpressionisevaluated?

(a) True
(b) False
(c) NONE
(d) NULL

5. Selectthecorrectoutputofthecode: 1
a = "Happy 2023 New Year"
a = a.split('2')
b = a[0] + a[1]+ a[2]
print(b)

(a) Happy 03 New Year (b) Happy 2 0 3 New Year


(b) 0 3 New Year (d) Happy New Year
6. Whichofthefollowingmodeinfileopeningstatementcreates a new file ? 1

(a) w+(b) r+ (c) r(d)Noneof the above

7 Which of the following is NOT a DML command? 1


a) SELECT b) DELETE c) UPDATE d) DROP

8 1
Which command displays name of all the databases present in RDBMS.
(a)SHOW ALL;(b) SHOW DATABASES;
(c) SHOW DATABASE;(d)VIEW DATABASE;

9 Whichofthefollowingstatement(s)wouldgiveanerrorafterexecutingthe 1
followingcode?
S="XII CBSE"
print(S) #Statement1
S="Bye Bye" #Statement2
S[0]='*' #Statement3
S=S+"Thankyou" #Statement4

(a) Statement1 (b) Statement 2


(c)Statement3 (d)Statement 4

10 ________________ is not a category of SQL command. 1


a) TCL b) SCL c) DCL d) DDL

CS SP - XII / 2022-23 Page 2 of 9


11 The load( ) function is available under ___________ module. 1
a) CSV b) pickle c)Text d)binary

12 Which SQL function is used to count the number of rows in a SQL query? 1
a)COUNT() b)NUMBER() c)SUM() d)COUNT(*)

13 The arrangement of computers in a network is called _____________ 1

(a) Topology (b) Router (c) Protocol (d) Network


14 WhatwillthefollowingexpressionbeevaluatedtoinPython? 1
print(15.0//4+(8+3.0))

(a)14.75 (b)14.0 (c)15 (d)15.5

15 Which of the following is not a DDL command? 1


a) UPDATE b) TRUNCATE c) ALTER d) None of the Mentioned

16 To run an SQL query from within Python, you may use <cursor>. 1
_________method().
(a) query() (b) execute()
(c) run() (d) All of these

Q17and18areASSERTIONANDREASONINGbasedquestions.Markthecorrectchoiceas
(a) BothAandRaretrueandRisthecorrectexplanationforA
(b) BothAandRaretrueandRisnotthecorrectexplanationforA
(c) AisTruebutRisFalse
(d) Aisfalse butRisTrue
17 Assertion(A):-Iftheargumentsinfunctioncallstatementmatcheswith the 1
numberandorderofargumentsasdefinedinthefunctiondefinition,suchargumentsare
called positionalarguments.
Reasoning(R):-
Duringafunctioncall,theargumentlistfirstcontainsdefaultargument(s)followedbyp
ositional argument(s).
18 Assertion (A): CSV (Comma Separated Values) is a file format for data storage 1
which looks like a text file.
Reason (R): The information is organized with one record on each line and each
field is separated by comma.

CS SP - XII / 2022-23 Page 3 of 9


SECTION - B

19 Rabi haswrittenacodetoinputanumberandcheckwhetheritisevenor odd. His code 2


is having errors. Rewrite the correct code and underline thecorrectionsmade.
def checkeven()
no=input(„Enter a number‟)
if no % 2 = 0:
print(„The number is even‟)
else:
Print(„The number is odd)
20 WritetwopointsofdifferencebetweenRouterandSwitch. 2
OR
Differentiate between Hacking and Cracking.
21 (a) GivenisaPythonstringdeclaration: 1
str = "My School@2022"
Writetheoutputof:print(str[-5::])
(b) Writetheoutputofthecodegivenbelow: 1
my_dict = {'name': 'Raj', 'mark': 99}
my_dict['mark'] = 75
my_dict['class'] = "XII"
print(my_dict.values())
22 What is the difference between CHAR & VARCHAR in SQL? 2
23 (a) Writethefullformsofthefollowing: 1
(i) SMTP (ii)WiFi
(b) WhatistheuseofBridge in a Network? 1
24 PredicttheoutputofthePythoncodegivenbelow: 2
def func(s):
x=[ ]
for i in range(len(s)):
a=s[i]
b=a.upper()
if a not in x and b not in x:
if a>'p':
x.append(a.upper())
else:
x.append(a)
return x
print(func('davschool'))
OR
PredicttheoutputofthePythoncodegivenbelow:
tup = (10,11,20,25,30,39,78)
li =list(tup)
new_li = []
for i in li:
if i%5==0:
new_li.append(i)
nt = tuple(new_li)
print(nt)

CS SP - XII / 2022-23 Page 4 of 9


25 What is a constraint? 2
Give at least two examples for the same.
OR
Categorize the following commands as DDL or DML:
DELETE, DROP, SELECT, CREATE
SECTION - C
26 (a) Write the difference between DROP TABLE and DROP VIEW. 1+2
(b) Write the outputs of the SQL queries (i) to (iv) based on the table given below:

(i) SELECT DISTINCT ANO FROM TRANSACT ;


(ii) SELECT ANO, COUNT(*), MIN(AMOUNT) FROM TRANSACT
GROUP BY ANO HAVING COUNT(*)> 1;
(iii) SELECT COUNT(*), SUM(AMOUNT) FROM TRANSACT
WHERE DOT <= '2017-06-01';
(iv) SELECT TYPE, COUNT(*) FROM TRANSACT GROUP BY TYPE;

27 Write a methodDISPLAY( ) in Python to read lines from a text file DIARY.TXT, and 3
displaythose lines, which are starting with an alphabet ‘T’.
OR
Write a method in python to read from a text file INDIA.TXT, to find and
display the occurrence of the word “is”.
For example:
If the content of the file is
“India is the fastest growing economy. India is looking for more investments
around the globe. The whole world is looking at India as a great market. Most of
the Indians can foresee the heights that India is capable of reaching.”
The output should be 4
28 (a) Write the outputs of the SQL queries (i) to (iv) based on the table given below: 2+1
Table: SOFTDRINK
DRINKCODE DNAME PRICE CALORIES
101 Lime and Lemon 20.00 120
102 Apple Drink 18.00 120
103 Nature Nectar 15.00 115
104 Green Mango 15.00 140
105 Aam Panna 20.00 135
106 Mango Juice Bahaar 12.00 150

CS SP - XII / 2022-23 Page 5 of 9


Table: LOCATION
DRINKCODE MPLACE
103 MUMBAI
102 NEW DELHI
105 HYDERABAD
104 MUMBAI
101 KOLKATA
106 NEW DELHI
(i) SELECT * FROM SOFTDRINK WHERE PRICE>15.00;
(ii) SELECT DRINKCODE, PRICE FROM SOFTDRINK WHERE DNAME LIKE ’%r’;
(iii) SELECT DRINKCODE, DNAME FROM SOFTDRINK
WHERE CALORIES BETWEEN110 AND 130;
(iv) SELECT S.DRINKCODE, MPLACE
FROM SOFTDRINK S,LOCATION L
WHERE S.DRINKCODE = L.DRINKCODE;
(b) Write MySql command that will be used to open an already existing
database “CONTACTS”.
29 WriteafunctionCOPY_INDEX(Li),whereLiisthelistofelementspassedas 3
argumenttothefunction.ThefunctionreturnsanotherlistnamedLi_in that stores the
indices of all Positive Elements of Li.

Forexample:
IfLicontains[21,4, -7,11, -97,56]

TheLi_inwillreturn-[0,1,3,5]
30 Write a function in Python PUSH_7(Arr), where Arr is a list of numbers. From 3
this list push all numbers divisible by 7 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 POP (Names) method in python (where Names is a list of names), to
remove the names by considering them to perform Pop operations of Stack.

SECTION - D

31 Hi Speed Technologies Ltd is a Delhi based organization which is expanding its


office setup to Chandigarh. At Chandigarh office campus, they are planning to 5
have 3 different blocks for HR, Accounts and Logistics related work. Each block
has number of computers, which are required to be connected in a network for
communication, data and resource sharing.

As a network consultant, you have to suggest the best network related solutions
for them for issues/problems raised in (i) to (v), keeping in mind the distances
between various blocks/locations and other given parameters.

CS SP - XII / 2022-23 Page 6 of 9


DELHI CHANDIGARH OFFICE

HR BLOCK ACCOUNTS
HEAD OFFICE
BLOCK

LOGISTIC
BLOCK

Shortest distances between various blocks/locations:

Number of Computers installed at various blocks are as follows:

(i) Suggest the most appropriate block/location to house the SERVER in the
CHANDIGARH Office (out of the 3 Blocks) to get the best and effective
connectivity. Justify your answer.

(ii) Suggest the best wired medium and draw the cable layout (Block to Block) to
efficiently connect various Blocks within the CHANDIGARH office compound.

(iii) Suggest a device/software and its placement that would provide data security
for the entire network of CHANDIGARH office.

(iv) Suggest network type out of the following kind of network for connecting
Delhi office with Chandigarh Office.
(a) PAN (b) WAN (c) MAN (d) LAN

(v) Suggest the devices to be installed in each of these buildings for connecting
computers installed within the building out of the following:
 Gateway
 Modem
 Switch

CS SP - XII / 2022-23 Page 7 of 9


32 (a) Rewrite the following code in python after removing all syntax error(s). Underline 2+3
each correction done in the code.

250 = Number
WHILE Number<=1000:
if Number=>750
print (Number)
Number=Number+100
else
print( Number*2)
Number=Number+50

(b) What are the possible outcome(s) executed from the following code? Also specify
the maximum and minimum values that can be assigned to variable PICKER.
import random
PICKER = random.randint (0, 3)
COLOR = ["BLUE", "PINK", "GREEN", "RED"]
for I in COLOR :
for J in range (1, PICKER):
print (I, end = " ")
print ()
(i) (ii) (iii) (iv)
BLUE BLUE PINK BLUEBLUE
PINK BLUEPINK PINKGREEN PINKPINK
GREEN BLUEPINKGREEN GREENRED GREENGREEN
RED BLUEPINKGREENRED REDRED

33 What is with statement in Python? 5


WriteaPrograminPythonthatdefinesandcallsthefollowinguserdefinedfunctions:

(i) ADDNEW() – To accept and add data of an student to a CSV


file„sturec.csv‟. Each record consists of a list of field namesasroll,
nameandmarktostorestudentroll,student nameandstudent
markrespectively.
(ii) COUNTSTU()–Tocountthe
totalnumberofrecordspresentintheCSVfilenamed„sturec.csv‟.

OR
Give any one point of difference between a binary file and a csv file.

Write a Program in Python that defines and calls the following user defined
functions:
a) pr_add() – To accept and add data of a product to a CSV file „pdata.csv‟. Each
record consists of a list with field elements as pid, pname and pprice to store
product id, product name and product price respectively.

b) pr_search()- To display the records of the product whose price is less than
500.

CS SP - XII / 2022-23 Page 8 of 9


SECTION - E
34 An Organisation decided to maintain a database for their Employees using SQL 4
to store the data. As a Head of the organisation, Ashok has decided that:
Name of the database – Organisation Name of the table – EMPLOYEE
The attributes of table EMPLOYEE are as follows:
ECODE – Numeric
NAME – Character of size 30
DESIGN – Character of size 20
SGRADE – character of size 3
DOJ – Date
Table: EMPLOYEE

a) Identify the attribute best suitable to be declared as a primary key.


b) Insert the following data into the attributes ECODE, NAME, DESIG,
SGRADE and DOJ respectively in the given table EMPLOYEE.
ECODE=109, NAME= “Abhishek Hota”, DESIGN=”MANAGER”,
SGRADE=”S01” and DOJ=”05-Jan-2020”.
c) Ashok wants to modify the data inside the table EMPLOYEE i.e. the
name “John Ken” with “Rashmi Arora” .Which command will he use to
change the name whose ECODE is 103.
d) Now Ashok wants to add new attribute i.e. ADDRESS in table
EMPLOYEE. Write a query to add this new attribute.

35 Amit Kumar of class 12 is writing a program to store roman numbers and find 4
their equivalents using a dictionary. He has written the following code. As a
programmer, help him to successfully execute the given task.
import __________ #Line 1
numericals = ,1: ‘I’, 4 : ‘IV’, 5: ‘V’ , 9: ‘IX’, 10:’X’, 40:’XL’,50:’L’,
90:’XC’, 100:’C’,400:’CD’,500:’D’,900:’CM’,1000:’M’-
file1 = open(“roman.log”,”_______”) #Line 2
pickle.dump(numerals,file1)
file1.close()
file2 = open(“roman.log”,’________”) #Line 3
num = pickle.load(file2)
file2.__________ #Line 4
n=0
while n!=-1:
print(“Enter 1,4,5,9,10,40,50,90,100,400,500,900,1000:”)
print(“or enter -1 to exit”)
n = int(input(“Enter numbers”))
if n!= -1:
CS SP - XII / 2022-23 Page 9 of 9
print(“Equivalent roman number of this numeral is:”,num*n+)
else:
print(“Thank You”)
(a) Name the module he should import in Line 1.
(b) In which mode, Amit should open the file to add data into the file in Line #2
(c) Fill in the blank in Line 3 to read the data from a binary file.
(d) Fill in the blank in Line 4 to close the file.

*****

CS SP - XII / 2022-23 Page 10 of 9

You might also like