5-1 (2)
5-1 (2)
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
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)
(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)
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
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(*)
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.
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
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
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.
HR BLOCK ACCOUNTS
HEAD OFFICE
BLOCK
LOGISTIC
BLOCK
(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
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
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.
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.
*****