Comp - SC - QP - (Set - 3)
Comp - SC - QP - (Set - 3)
CLASS- XII
SUB : COMPUTER SCIENCE (083)
Time: 3 hours Maximum Marks: 70
General Instructions :-
1. Please check this question paper contains 35 questions.
2. All questions are compulsory.
3. This question paper is divided into 5 sections- A, B, C, D and E.
4. Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.
5. Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
6. Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
7. Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
8. Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
9. All programming questions are to be answered using Python Language only.
2. Given a Tuple tup1= (10, 20, 30, 40, 50, 60, 70, 80, 90) 1
What will be the output of print (tup1 [3:7:2])?
(a) (40,50,60,70,80) (b) (40,50,60,70)
(c) [40,60] (d) (40,60)
3. Which of the following functions can not be used with a tuple? 1
(a) max( ) (b) sort (c) count (d) sorted
4. Select the correct output of the code: 1
str=“computer is fun”
p=len(str)
substr=“fun”
print(str.find(substr, 0, p))
(a) 13 (b) 12 (c) -1 (d) 0
(a) Delhi#Mumbai#Chennai#Kolkata#
(b) Mumbai#Chennai#Kolkata#Mumbai#
(c) Mumbai# Mumbai #Mumbai # Delhi#
(d) Mumbai# Mumbai #Chennai # Mumbai
11. Write the output of the following code? 1
print(S.replace('2','2+1'))
print(S[::-2]))
def Findoutput():
L="Program"
X=""
L1=[ ]
count = 1
for i in L:
if i in ['a', 'e', 'i', 'o', 'u']:
X=X+i.swapcase()
else:
if count%2 != 0:
X=X+str(len(L[:count]))
OR
def Display(str):
m=""
for i in range(0,len(str)):
if(str[i].isupper()):
m=m+str[i].lower()
elif str[i].islower():
m=m+str[i].upper()
else:
if i%2!=0:
m=m+str[i-1]
else:
m=m+"$"
print(m)
Display('Python3.10')
21. Rewrite the following code in Python after removing all syntax error(s). Underline each 2
correction done in the code.
value=30
for res in range(0, value)
If res%4==0:
print(res*4)
elseif res%5==0:
print(res+3)
else:
print(res+10)
22. Write the Python statement for each of the following tasks using BUILT-IN 2
functions/methods only:
(a) Sort the elements of a tuple Tup in ascending order.
(b) Remove an element present at index 3 of a List Li.
OR
24. Arjun has created a table SMS containing SRoll_no, Sname, SClass, SPhone_no and 2
percent. Later, he realizes that the field Sphone_no may have duplicate values. Help him
to write a SQL command to set the property of this field to deny duplicate values. Also
he needs help to write SQL command to see the structural detail of the table SMS.
OR
Ms. Trisha of a software company created a table Clients under a database Company.
After creating table, she now wants to add an additional column CPortfolio to store
textual information containing maximum of 100 characters and that can’t be blank. Also
she wants to view all the tables present under the database Company. Help her to write
the SQL commands to complete the above tasks.
25. (a) Expand the following terms: 2
IMAP, GSM
(b) Give one difference between LAN and WAN.
OR
(a) Define the term Telnet with respect to networks
(b) How is server different from client?
Table: PRODUCT
PID BRAND CITY_STORE PNAME PRICE
111 SONY DELHI TV 70000
222 NOKIA MUMBAI MOBILE 50000
333 ONIDA DELHI TV 30000
444 SONY MUMBAI MOBILE 35000
555 BLACKBERRY CHENNAI MOBILE 25000
666 DELL DELHI LAPTOP 20000
Table: ORDER
CID CNAME QTY PID
101 ROHAN SHARMA 20 222
102 DEEPAK KUMAR 10 666
103 MOHAN KUMAR 5 111
104 SAHIL BANSAL 3 333
105 NEHA SONI 7 444
106 SONAL AGARWAL 5 333
107 ARUN SINGH 15 666
(a) Identify the most appropriate column, which can be considered as Primary key
of the Table Store.
(b) If three columns are added and one row is deleted from the table Store, then what
will be the new degree and cardinality of the above table?
(c) Write the SQL statement to delete the record of item having Rate less than 10.
28. A list contains following record of a ‘Computerʼ: [MACAddress, Brand, Price, RAM] 3
Write separate user defined functions to perform given operations on the stack named
‘Systemʼ:
(ii) Pop_element() - To Pop the objects from the stack and display them. Also,
display “Stack Empty” when there are no elements in the stack.
For example:
[“Lenovo”, 75000]
[“Lenovo”, 75000]
[”Apple”, 110000]
Stack Empty
OR
BCCI has created a dictionary containing top players and their runs as key value pairs of
cricket team. Write a program, with separate user defined functions to perform the
following operations:
● Push the keys (name of the players) of the dictionary into a stack, where the
corresponding value (runs) is greater than 49.
For example:
(b) Consider the following tables WORKER and PAYLEVEL and write the output
of the following SQL queries (i) to (iv) .
Table : WORKER
ECODE NAME DESIGN PLEVEL DOJ DOB
11 Radhe Shyam Supervisor P001 13-Sep-2004 23-Aug-1981
12 Chander Nath Operator P003 22-Feb-2010 12-Jul-1987
13 Fizza Operator P003 14-Jun-2004 14-Oct-1983
15 Ameen Ahmed Machanic P002 21-Aug-2006 13-Mar-1984
18 Sanya Clerk P002 19-Dec-2005 09-Jun-1987
Table: PAYLEVEL
30. Write a function RevText() to read a text file “ Story.txt “ and Print the word(s) starting 3
with ‘I’ in reverse order, rest of the words will be printed as it is.
SECTION-D
31. Consider the following tables ITEM and CUSTOMER, write SQL commands for the 1*4=4
statements (a) to (d)
TABLE: ITEM
TABLE: CUSTOMER
(a) To display the details of those Customers whose city is Delhi in the descending
order of Customer_Name.
(b) To display the details of Items whose Price is not in the range of 35000 to 55000
(Both values included).
32. Given below is a CSV file named as ‘Student.csv’. Write the statement 1 to 4 4
to complete the program code.
import csv
fh = open( _____ , ______ , newline='') #Statement-1
stuwriter = csv. ___________ #Statement-2
data = [ ]
header = ['ROLL_NO', 'NAME', 'CLASS', 'SECTION']
data.append(header)
for i in range(5):
roll_no = int(input("Enter Roll Number : "))
name = input("Enter Name : ")
Class =input("Enter Class : ")
section =input("Enter Section : ")
rec = [ _________ ] #Statement-3
data.append(rec)
stuwriter.________ #Statement-4
fh.close()
(a) Identify the missing code for blank space in line marked as Statement-1?
(i) "Student.csv","r+"
(ii) "Student.csv","w"
(iii) "Student.csv","r"
(iv) "Student.csv","wb"
(b) Choose the function name (with argument) that should be used in the blank
space of line marked as Statement-2
(i) reader(fh)
(ii) reader(MyFile)
(iii) writer(fh)
(iv) writer(MyFile)
SECTION-E
Main Resource
Training
Accounts