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

Class 12 Computer Science Sample Paper Set 11

The Class 12 Computer Science Sample Paper is a meticulously crafted resource aimed at helping students prepare for their board examinations. It includes a diverse set of questions, such as programming problems, theoretical concepts, and case studies, aligned with the latest CBSE syllabus and exam pattern. Covering essential topics like Python programming, data structures, database management, and computer networks, this sample paper enhances both conceptual understanding and practical skills.

Uploaded by

Artham Resources
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
88 views

Class 12 Computer Science Sample Paper Set 11

The Class 12 Computer Science Sample Paper is a meticulously crafted resource aimed at helping students prepare for their board examinations. It includes a diverse set of questions, such as programming problems, theoretical concepts, and case studies, aligned with the latest CBSE syllabus and exam pattern. Covering essential topics like Python programming, data structures, database management, and computer networks, this sample paper enhances both conceptual understanding and practical skills.

Uploaded by

Artham Resources
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Dear Teachers and Students,

Join School of Educators' exclusive WhatsApp, Telegram, and Signal groups for FREE access
to a vast range of educational resources designed to help you achieve 100/100 in exams!
Separate groups for teachers and students are available, packed with valuable content to
boost your performance.

Additionally, benefit from expert tips, practical advice, and study hacks designed to enhance
performance in both CBSE exams and competitive entrance tests.

Don’t miss out—join today and take the first step toward academic excellence!

Join the Teachers and Students


Group by Clicking the Link Below
Series ARSP/11 Set ~ 11
Roll No. Q.P Code 15/11/11
Candidates must write the Q.P Code
on the title page of the answer-book.

 Please check that this question paper contains 10 printed pages.


 Q.P. Code given on the right hand side of the question paper should be written
on the title page of the answer-book by the candidate.
 Please check that this question paper contains 37 questions.
 Please write down the serial number of the question in the answer-book
before attempting it.
 15 Minute times has been allotted to read this question paper. The question
paper will be distributed at 10:15 a.m. From 10.15 a.m to 10.30 a.m, the students
will read the question paper only and will not write any answer on the answer –
book during this period.

COMPUTER SCIENCE

Time allowed: 3 hours Maximum Marks: 70


General Instructions:

​This question paper contains 37 questions.

All questions are compulsory. However, internal choices have been provided in some questions. Attempt only one of the

choices in such questions.

The paper is divided into 5 Sections- A, B, C, D and E.

Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.

Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.

Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.

Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.

Section E consists of 2 questions (36 to 37). Each question carries 5 Marks.

All programming questions are to be answered using Python Language only.

In case of MCQ, text of the correct answer should also be written.

Section A
1. State true or false: [1]
An if statement can either have elif clause or else clause.
2. Which is the subset of SQL commands used to manipulate database structures, including tables? [1]

a) Data Differential Language b) Both Data Definition Language (DDL)


and Data Manipulation Language (DML)

c) Data Definition Language (DDL) d) Data Manipulation Language (DML)


3. >>> m = [[x, x*2, x*3] for x in range (3,6)] [1]

a) Error b) [3,6,9,[4,8,12,[5,10,15]]]

c) [[3,6,9],[4,8,12],[5,10,15]] d) [3,6,9,4,8,12,5,10,15]
4. Suppose there is a list such that: l = [2, 3, 4]. [1]
If we want to print this list in reverse order, which of the following methods should be used?

a) reversed(I) b) list(reversed(I))

c) list(reverse[(I)]) d) reverse(I)
5. Write the output of the Python code given below: [1]

g=0
def fun1(x,y):
global g
g=x+y
return g
def fun2(m,n):
global g
g=m-n
return g
k=fun1(2,3)
fun2(k,7)
print(g)

6. Which type of transmission media is the least expensive to manufacture? [1]

a) Twisted pair cable b) CAT cable

c) Coaxial d) Fibre optic


7. Which function is used to write a list of strings in a file? [1]

a) writefullline( ) b) writeline( )

c) writestatement( ) d) writelines( )
8. Which of the following is a procedural language? [1]

a) Relational Algebra b) Query Language

c) Tuple Relational Calculus d) Domain Relational Calculus


9. Which of the following is not a valid DML command in SQL? [1]

a) INSERT b) DELETE

c) ALTER d) UPDATE
10. Given a file "mine.txt" as shown below: [1]
I am line 1
I am line 3
What would be the output of following code?
print(file("mine.txt").readlines())
11. State true or false: [1]
The first line of function definition that begins with keyword def and ends with a colon ( : ), is also known as function
header.
12. Which of the following is/are not applications of stacks? [1]

a) reversing the order b) printer shared among four computers

c) infix to postfix conversion d) postfix expression evaluation


13. Explain the usage of HAVING clause in GROUP BY command in RDBMS with the help of an example. [1]
14. A ________ is a network spread across states, countries or whole world. [1]

a) PAN b) LAN

c) WAN d) MAN
15. What is the output of the following code? [1]

t = (10, 20, 30, 40, 50, 50, 70)


print(t[5:-1])

a) (50,70) b) (50,)

c) (50,50,70) d) Blank output()


16. What is the full form of SQL? [1]

a) Simple Query Language b) Structured Query Language

c) Structured Query List d) Simple Query List


17. If value of checksum is 0, then message is [1]

a) accepted b) resend

c) rejected d) sent back


18. Routing tables of a router keeps track of [1]

a) Routes to use for forwarding data to its b) Port Assignments to network devices.
destination.

c) Distribute IP address to network devices. d) MAC Address Assignments.


19. Assertion (A): The frozen sets are the immutable form of the normal sets. [1]
Reason (R): The items of the frozen set can be changed.

a) Both A and R are true and R is the correct b) Both A and R are true but R is not the correct
explanation of A. explanation of A.

c) A is true but R is false. d) A is false but R is true.


20. Assertion (A): To store the data permanently into the file we use file handling. [1]
Reason (R): A file is a named location on a disk to store related information.

a) Both A and R are true and R is the correct b) Both A and R are true but R is not the correct
explanation of A. explanation of A.

c) A is true but R is false. d) A is false but R is true.


21. Assertion (A): By default, a function must be called with the correct number of arguments. [1]
Reason (R): If your function expects 2 arguments, you have to call the function with 2 arguments, not more, and not less.

a) Both A and R are true and R is the correct b) Both A and R are true but R is not the correct
explanation of A. explanation of A.

c) A is true but R is false. d) A is false but R is true.


Section B
22. Give one advantage and one disadvantage of optical fiber cable and coaxial cable used in communication. [2]
23. Write Python code to insert following records into the order-details table. [2]
Database → sales
User id → Admin
Password → salar345
table name → order-details

ORDNUMB PARTNUMB NUMBORD QUOTPRIC

12489 AX12 11 14.95

12495 BT04 1 402.99

12491 BZ66 1 311.95

12498 CX11 2 57.95

24. Predict the output. [2]


i. 'wonders'.center (12, '*')
ii. 'wonders25'.isalnum()
iii. 'Hello1235 '.isdigit()
iv. 'Hi Hello'.istitle()
v. 'This is nice.' endswith(''nice")
vi. "wonder".zfill(10)
OR
What is the output of the following?
L = ['im', 'ur']
for i in L:
print(i.upper())
print(L)
25. Consider the structure of table Doctor given below [2]
Doctor
Doctor_id(p)
Doctor_Name
Hospital_id(F)
Joining_Date
Speciality
Salary
Experience.
Write Python Code to create the above table.
26. There are two types of else clauses in Python. What are these two types of else clauses? [2]
OR
Read the code shown below and pick out the keys

d = {'One' : 1, 'Two' : 2, 'Three' : 3}

27. Define the following terms: [2]


i. dump() method
ii. load() method
OR
Considering the two files p1.txt and p2.txt created in previous question, what output will be produced by following
codefragments?
i. obj1 = open("p1.txt", "r")
s1 = obj1.readline()
s2 = obj1.read(15)
print(s2)
obj1.close()
ii. obj1 = open("p2.txt","r")
s1 = obj1.readline()
s2 = obj1.read(15)
print(s2)
obj1.close()
28. Predict the output of the following code: [2]
def execute (x, y = 200):
temp = x + y
print(temp, x, y)
a , b = 50, 20
execute(b)
execute(a, b)
execute(b, a)
Section C
29. Write the definition of a function Sum3(L) in Python, which accepts a list L of integers and displays the sum of all such [3]
integers from the list L which end with the digit 3.
For example, if the list L is passed
[123, 10, 13, 15, 23]
then the function should display the sum of 123, 13, 23, i.e. 159 as follows:
Sum of integers ending with digit 3 = 159
OR
Write the definition of a function ChangeGender() in Python, which reads the contents of a text file "BIOPIC.TXT" and
displays the content of the file with every occurrence of the word 'he' replaced by 'she'. For example, if the
content of the file "BIOPIC.TXT" is as follows:
Last time he went to Agra,
there was too much crowd, which he did not like.
So this time he decided to visit some hill station.
The function should read the file content and display the output as follows:
Last time she went to Agra,
there was too much crowd, which she did not like.
So this time she decided to visit some hill station.
30. Consider the following table BATSMEN: [3]
Table: BATSMEN

PNO NAME SCORE

P1 RISHABH 52

P2 HUSSAIN 45

P3 ARNOLD 23

P4 ARNAV 18

P5 GURSHARAN 52

a. Identify and write the name of the Candidate Keys in the given table BATSMEN.
b. How many tuples are there in the given table BATSMEN?
OR
a. Consider the following tables Student and Sport:
Table : Student

ADMNO NAME CLASS

1100 MEENA X

1101 VANI XI

Table : Sport

ADMNO GAME

1100 CRICKET
1103 FOOTBALL

What will be the output of the following statement?

SELECT * FROM Student, Sport;

b. Write the output of the queries (i) to (iv) based on the table, GARMENT given below:
TABLE : GARMENT

GCODE TYPE PRICE FCODE ODR_DATE

G101 EVENING GOWN 850 F03 2008-12-19

G102 SLACKS 750 F02 2020-10-20

G103 FROCK 1000 F01 2021-09-09

G104 TULIP SKIRT 1550 F01 2021-08-10

G105 BABY TOP 1500 F02 2020-03-31

G106 FORMAL PANT 1250 F01 2019-01-06

i. SELECT DISTINCT(COUNT(FCODE))FROM GARMENT;

ii. SELECT FCODE, COUNT(*), MIN(PRICE) FROM GARMENT GROUP BY FCODE HAVING COUNT(*)>1;

iii. SELECT TYPE FROM GARMENT WHERE ODR_DATE >'2021-02-01' AND PRICE <1500;

iv. SELECT * FROM GARMENT WHERE TYPE LIKE 'F%';

31. What will be the output of following programs? [3]


i. num = 1
def myfunc():
return num
print(num)
print(myfunc())
print(num)
ii. num = 1
def myfunc():
num = 10
return num
print(num)
print(myfunc())
print(num)
iii. num = 1
def myfunc():
global num
num = 10
return num
print(num)
print(myfunc())
print(num)
iv. def display ():
print ("Hello", end = ' ')
display()
print("there!")
OR
Write definition of a method OddSum(NUMBERS) to add those values in the list of NUMBERS, which are not even.
Section D
32. Write a program to implement a stack for these book details (bookno, bookname). That is, now each item node of the [4]
stack contains two types of information -a bookno and its name. Just implement push and display operations.
OR
A linear stack called status contains the following information:
Phone number of Employee
Name of Employee
Write the following methods to perform given operations on the stack status:
i. Push_element () To Push an object containing Phone number of Employee and Name of Employee into the stack.
ii. Pop_element () To Pop an object from the stack and to release the memory.
33. Write a Python program that read a data from file "info.dat" and replace a word with another word. [4]
34. Consider the following tables CABHUB and CUSTOMER and answer the following parts of this question : [4]
Table: CABHUB

Vcode VehicleName Make Color Capacity Charges

100 Innova Toyota WHITE 7 15

102 SX4 Suzuki BLUE 4 14

104 C Class Mercedes RED 4 35

105 A-Star Suzuki WHITE 3 14

108 Indigo Tata SILVER 3 12

Table: CUSTOMER

CCode CName Vcode

1 Hemant Sahu 101

2 Raj Lai 108

3 Feroza Shah 105

4 Ketan Dhal 104

Give the output of the following SQL queries :


i. SELECT COUNT (DISTINCT Make) FROM CABHUB ;
ii. SELECT MAX(Charges), MIN(Charges) FROM CABHUB ;
iii. SELECT COUNT(*), Make FROM CABHUB ;
iv. SELECT VehicleName FROM CABHUB WHERE Capacity = 4;
OR
Consider the following tables ACTIVITY and COACH and answer the following parts of this question :
Table: ACTIVITY

Acode ActivityName Stadium ParticipantsNum PrizeMoney ScheduteDate

1001 Relay 100 × 4 Star Annex 16 10000 23-Jan-04


1002 High jump Star Annex 10 12000 12-Dec-03

1003 Shot Put Super Power 12 8000 14-Feb-04

1005 Long Jump Star Annex 12 9000 01-Jan-04

1008 Discuss Throw Super Power 10 15000 19-Mar-04

Table : COACH

Pcode Name Acode

1 Ahmad Hussain 1001

2 Ravinder 1008

3 Janila 1001

4 Naaz 1003

Give the output of the following SQL queries :


i. SELECT COUNT (DISTINCT ParticipantsNum) FROM ACTIVITY;
ii. SELECT MAX(ScheduleDate), MIN(ScheduleDate) FROM ACTIVITY;
iii. SELECT Name, ActivityName FROM ACTIVITY A, COACH C
WHERE A.Acode = C.Acode AND A.ParticipantsNum = 10;
iv. SELECT DISTINCT ParticipantsNum FROM ACTIVITY;
35. Consider the table product with the following structure. [4]
P_ID, ProductName, Manufacturer, Price.
Write Python code to increase the price of all products by 50.
Section E
36. Tech Up Corporation (TUC) is a professional consultancy company. The company is planning to set up their new offices [5]
in India with its hub at Hyderabad. As a network adviser, you have to understand their requirement and suggest to them
the best available solutions. Their queries are mentioned as (i) to (v) below.
Physical locations of the blocks of TUC

Block to block distances (in metre)

Block (From) Block (To) Distance

Human Resource Conference 60

Human Resource Finance 120

Conference Finance 80

Expected number of computers to be installed in each block

Block Computers

Human Resource 125

Finance 25
Conference 60

i. What will the most appropriate block, where TUC should plan to install their server?
ii. Draw a block to block cable layout to connect all the buildings in the most appropriate manner for efficient
communication.
iii. What will be the best possible connectivity out of the following, you will suggest to connect the new setup of offices
in Bengalore with its London based office?
Infrared
Satellite Link
Ethernet Cable
iv. Which of the following devices will be suggested by you to connect each computer in each of the buildings?
Gateway
Switch
Modem
v. Company is planning to connect its Block in Hyderabad which is more than 20 km. Which type of network will be
formed?
37. Write queries for (i) to (iv) and find outputs for SQL queries (v) to (viii), which are based on the tables [5]
Table: VEHICLE

VCODE VEHICLETYPE PERKM

V01 VOLVO BUS 150

V02 AC DELUXE BUS 125

V03 ORDINARY BUS 80

V05 SUV 30

V04 CAR 18

Table: TRAVEL

CNO CNAME TRAVELDATE KM VCODE NOP

101 K. Niwal 2015-12-13 200 V01 32

103 Fredrick Sym 2016-03-21 120 V03 45

105 Hitesh Jain 2016-04-23 450 V02 42

102 Ravi Anish 2016-01-13 80 V02 40

107 John Malina 2015-02-10 65 V04 2

104 Sahanubhuti 2016-01-28 90 V05 4

106 Ramesh Jaya 2016-04-06 100 V01 25

Note:
• PERKM is Freight Charges per kilometre.
• Km is kilometres Travelled
• NOP is number of passengers travelled in vehicle.
i. To display CNO, CNAME, TRAVELDATE from the table TRAVEL in descending order of CNO
ii. To display the CNAME of all customers from the table TRAVEL who are travelling by vehicle with code V01 or V02
iii. To display the CNO and CNAME of those customers from the table TRAVEL who travelled between 2015-12- 31 and
2015-05-01
iv. To display all the details from table TRAVEL for the customers, who have travel distance more than 120 KM in
ascending order of NOP
v. SELECT COUNT (*), VCODE FROM TRAVEL GROUP BY VCODE HAVING COUNT (*) > 1
vi. SELECT DISTINCT VCODE FROM TRAVEL
vii. SELECT A.VCODE, CNAME, VEHICLETYPE FROM TRAVEL A, VEHICLE B WHERE A. VCODE = B.
VCODE and KM < 90
viii. SELECT CNAME, KM*PERKM FROM TRAVEL A, VEHICLE B WHERE A.VCODE = B.VCODE AND A.
VCODE 'V05'
OR
Consider the following tables ACTIVITY and COACH. Write SQL commands for the following statements
Table: ACTIVITY

Acode ActivityName Stadium ParticipantsNum PrizeMoney ScheduleDate

1001 Relay 100 × 4 Star Annex 16 10000 23-Jan-04

1002 High jump Star Annex 10 12000 12-Dec-03

1003 Shot Put Super Power 12 8000 14-Feb-04

1005 Long Jump Star Annex 12 9000 01-Jan-04

1008 Discuss Throw Super Power 10 15000 19-Mar-04

Table: COACH

Pcode Name Acode

1 Ahmad Hussain 1001

2 Ravinder 1008

3 Janila 1001

4 Naaz 1003

i. To display the names of all activities with their Acodes in descending order.
ii. To display sum of PrizeMoney for the Activities played in each of the Stadium separately.
iii. To display the coach's names and Acodes in ascending order of Acode from the table COACH.
iv. To display the content of all activities for which ScheduleDate is earlier than 01-01-2004 in ascending order of
ParticipantsNum.

You might also like