Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (1 vote)
430 views14 pages

Class 12 Computer Science Sample Paper Set 2

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
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 (1 vote)
430 views14 pages

Class 12 Computer Science Sample Paper Set 2

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
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/ 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/02 Set ~ 2
Roll No. Q.P Code 15/2/2
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]
The keys of a dictionary must be of immutable types.
2. Select the correct SQL query to find the temperature in the increasing order of all cities. [1]

a) SELECT city, temperature FROM weather b) SELECT city, temperature FROM weather;
ORDER BY city;

c) SELECT city, temperature FROM weather d) SELECT city FROM weather ORDER BY
ORDER BY temperature; temperature;
3. The set of records retrieved after executing an SQL query over an established database connection is called [1]
________.

a) table b) resultset

c) sqlresult d) result
4. Which of the following functions does not necessarily accept only iterables as arguments? [1]

a) chr() b) max()

c) enumerate() d) all()
5. Is the following statement valid? Why? [1]
>>> a = "a"
6. What is a Firewall in Computer Network? [1]

a) An operating System of Computer Network. b) A web browsing Software.

c) The physical boundary of Network. d) A system designed to prevent unauthorized


access.
7. To open a file c:\core.txt for writing, we can use: [1]
a. file = open(//c: \core.txt", "w")
b. file = open("c:\ \core.txt", "w")
c. file = open(r"c: \ core.txt", "w")
d. file = open(file = "c:\core.txt", "w")
e. file = open(file = "c: \ \ core.txt", "w")
f. file = open(//c:\ res.txt")

a) c, f b) a, e

c) d, f d) b, c
8. ________ operation is required when you want to create your records into a database table. [1]

a) Insert b) Read

c) Update d) Delete
9. Fill in the blank: [1]
________ statement of SQL is used to insert new records in a table.

a) INSERT b) CREATE

c) ALTER d) UPDATE
10. Write a line of code that writes "Hello world!" to a file opened with file object my file. [1]
11. State true or false: [1]
A void function also returns a value i.e., None to its caller.
12. Pushing is an act of: [1]

a) Adding items to a stack b) Taking off items from stack

c) Adding values d) Transferring items from stack


13. Which of the following is NOT a DML command. [1]
DELETE, DROP, INSERT, UPDATE
14. A repeater takes a weak and corrupted signal and ________ it. [1]

a) Reroutes b) Resembles

c) Regenerates d) Amplifies
15. What will be the result of the following code? [1]

dl={"abc":5, "def":6, "ghi":7}


print(dl[0])

a) 5 b) abc

c) Error d) {"abc":5J}
16. Which of the following function returns the total number of values? [1]

a) MIN b) MAX

c) COUNT d) SUM
17. Which transmission media is capable of having a much higher bandwidth (data capacity)? [1]

a) Untwisted cable b) Twisted pair cable

c) Fibre optic d) Coaxial


18. What is the access point (AP) in wireless LAN? [1]

a) Wireless connector b) Wireless devices itself

c) Device that allows wireless devices to d) Both device that allows wireless devices to
connect to a wired network connect to a wired network and wireless
devices itself
19. Assertion (A): Pd.Series([4, 6, 9], range(1, 5)) will lead to value error. [1]
Reason (R): The length of data and index must be same on series.

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

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


20. Assertion (A): pandas is defined as an open-source library that is built on top of the NumPy library. [1]
Reason (R): pandas provides fast analysis, data cleaning, and preparation of the data for the user.

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

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


21. Assertion (A): Python allows us to divide a large program into the basic building blocks known as a function. [1]
Reason (R): The function contains the set of programming statements enclosed by ( ).

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

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


Section B
22. What are the basic methods of checking errors in the data being transmitted over networks? [2]
23. Write Python code to create a table faculty with the following fields. [2]
Id, LastName, FirstName, Locationid, phone, rank, startdate
Rank should be one of the following
ASSO, FULL, ASST, INST
24. Write a program to sort the list alphabetically in a dictionary. [2]
OR
Find the output of the following code:

num=123
f = 0
s = 0
while(num>3):
rem=num%100
if(rem%2 != 0):
f+=rem
else:
s+=rem
num /= 100
print(f-s)

25. Write the code to create the following table Student with the following fields [2]
RollNo
FirstName
LastName
Address
ContactNo
Marks
Course
Rank
In the table, Rank should be Good, Best, Bad, Worst, Average.
26. Write the suitable method's name for the below conditions. [2]
i. Adds an element in the end of list.
ii. Returns the index of first occurrence.
iii. Adds contents of list2 to the end of list1.
OR
How to traverse a string using for loop?
27. What are the advantages of saving data in binary form and text form? [2]
OR
What is a delimited text file?
28. What will be the output of the following? Explain. [2]

def f1():
n = 44
def f2():
n = 77
print("Value of n", n)
print("Value of n", n)

Section C
29. 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
Trace the flow of execution for following programs:
i. 1 def power(b., p):
2 r = b ** p
3 return r
4
5 def cpower(a):
6a=a+2
7 a = power(a, 0.5)
8 return a
9
10 n = 5
11 result = cpower(n)
12 print (result)
ii. 1. def increment(x)
2. x = x + 1
3.
4. # main program
5. x = 3
6. print(x)
7. increment(x)
8. print(x)
iii. 1. def increment(x):
2. z = 45
3. x = x + 1
4. return x
5.
6. # main
7. y = 3
8. print(y)
9. y = increment(y)
10. print(y)
11. q = 77
12. print(q)
13. increment(q)
14. print(q)
15. print(x)
16. print(z)
30. You want to group the result set based on some column's value. Also, you want that the grouped result should [3]
appear in a sorted order. In which order will you write the two clauses (for sorting and for grouping). Give
example to support your answer.
OR
Explain IS NULL clause in SQL.
31. Write a program that reads a date as an integer in the format MMDDYYYY. The program will call a function [3]
that prints print out the date in the format <Month Name><day>, <year>.
Sample run :
Enter date: 12252019
December 25, 2019
OR
Write a function that receives an octal number and prints the equivalent number in other number bases i.e., in
decimal, binary, and hexadecimal equivalents.
Section D
32. Write Push (contents) and Pop (contents) methods in Python to add numbers and remove numbers considering [4]
them to act as Push and Pop operations of stack.
OR
Write a Python program to check if a string is a palindrome or not using stack.
33. Why it is important to close a file before exiting? [4]
Write a program in Python that defines and calls the following user defined functions:
i. Add_Book() : Takes the details of the books and adds them to a csv file 'Book.csv'. Each record consists of a
list with field elements as book_ID, B_name and pub to store book ID, book name and publisher
respectively.
ii. Search_Book() : Takes publisher name as input and counts and displays number of books published by them.
34. Consider the following tables CARDEN and CUSTOMER. Write SQL commands for the following statements. [4]
Table: CARDEN

Ccode CarName Make Color Capacity Charges

501 A-Star Suzuki RED 3 14

503 Indigo Tata SILVER 3 12

502 Innova Toyota WHITE 7 15

509 SX4 Suzuki SILVER 4 14

510 C Class Mercedes RED 4 35

Table: CUSTOMER

CCode Cname Ccode

1001 Hemant Sahu 501

1002 Raj Lai 509

1003 Feroza Shah 503

1004 Ketan Dhal 502

i. To display the names of all the silver colored Cars.


ii. To display the name of the car, make and capacity of cars in descending order of their seating capacity.
iii. To display the highest charges at which a vehicle can be hired from CARDEN.
iv. To display the customer name and the corresponding name of the cars hired by them.
OR
Consider the following table named "GARMENT". Write command of SQL for (i) to (iv).
Table : GARMENT

GCODE GNAME SIZE COLOUR PRICE

111 TShirt XL Red 1400.00

112 Jeans L Blue 1600.00

113 Skirt M Black 1100.00

114 Ladies Jacket XL Blue 4000.00

115 Trousers L Brown 1500.00

116 Ladies Top L Pink 1200.00

i. To display names of those garments that are available in 'XL' size.


ii. To display codes and names of those garments that have their names starting with 'Ladies'.
iii. To display garment names, codes and prices of those garments that have price in the range 1000.00 to 1500.00
(both 1000.00 and 1500.00 included).
iv. To change the colour of garment with code as 116 to "Orange".
35. Write the Python code for (i) and (ii) on the basis of table College. [4]

No Name Age Department DateofJoin Basic Sex


1 Aren 51 Mathematics 22/01/91 8500 M

2 Reeta 27 Chemistry 14/02/94 9000 F

3 Viren 49 Mathematics 03/01/88 9000 M

4 Prakash 22 Physics 17/02/92 8000 M

5 Shaiaz 45 Biology 13/02/88 10500 M

6 Urvashi 29 Biology 10/02/93 8500 F

i. To insert a new row in the table College with the following data "Atm", 27, "Physics", "15/05/02", 8500, "M"
ii. To delete a row from table in which name is Viren.
Section E
36. Uplifting Skills Hub India is a knowledge and skill community which has an aim to uplift the standard of [5]
knowledge and skills in society. It is planning to set up its training centres in multiple towns and villages pan
India with its head offices in the nearest cities. They have created a model of their network with a city, a town,
and 3 villages as follows.
As a network consultant, you have to suggest the best network related solutions for their issues/ problems raised
in (i) to (iv) keeping in mind the distance between various locations and given parameters.

The shortest distance between various location:

VILLAGE 1 to B_TOWN 2 KM

VILLAGE 2 to B_TOWN 1.0 KM

VILLAGE 3 to B_TOWN 1.5 KM

VILLAGE 1 to VILLAGE 2 3.5 KM

VILLAGE 1 to VILLAGE 3 4.5 KM

VILLAGE 2 to VILLAGE 3 2.5 KM

A_CITY Head Office to B_HUB 25 KM

The number of Computers installed at various locations is as follows:

B_TOWN 120

VILLAGE 1 15

VILLAGE 2 10

VILLAGE 3 15

A_CITY Head OFFICE 6

Note:
In Villages, there are community centers, in which one room has been given as a training center for this
organization to install computers.
The organization has got financial support from the government and top IT companies.
i. Suggest the most appropriate location of the SERVER in the B_HUB (out of the 4 locations), to get the best
and effective connectivity. Justify your answer.
ii. Suggest the best-wired medium and draw the cable layout (location to location) to efficiently connect various
locations within the B_HUB.
iii. Which hardware device will you suggest to connect all the computers within each location of B_HUB?
iv. Which service/protocol will be most helpful to conduct live interactions of Experts from Head Office and
people at all locations of B_HUB?
37. Write SQL commands for the queries (i) to (iv) and output for (v) to (viii) based on the tables 'Watches' and Sale [5]
given below.
Watches

Watchid WatchName Price Type Qty_Store

W001 High Time 10000 Unisex 100

W002 Life Time 15000 Ladies 150

W003 Wave 20000 Gents 200

W004 High Fashion 7000 Unisex 250

W005 Golden Time 25000 Gents 100

Sale

Watchid Qty_Sold Quarter

W001 10 1

W003 5 1

W002 20 2

W003 10 2

W001 15 3

W002 20 3

W005 10 3

W003 15 4

i. TO DISPLAY ALL THE DETAILS OF THOSE WATCHES WHOSE NAME ENDS WITH TIME.
ii. TO DISPLAY WATCH'S NAME AND PRICE OF THOSE WATCHES WHICH HAVE PRICE RANGE IN
BETWEEN 5000-15000.
iii. TO DISPLAY TOTAL QUANTITY IN-STORE OF UNISEX TYPE WATCHES.
iv. TO DISPLAY WATCH NAME AND THEIR QUANTITY SOLD IN the FIRST QUARTER.
v. SELECT MAX (PRICE), MIN(QTY_STORE) FROM WATCHES;
vi. SELECT QUARTER, SUM(QTY_SOLD) FROM SALE GROUP BY QUARTER;
vii. SELECT WATCHNAME, PRICE, TYPE FROM WATCHES W, SALE S WHERE W. WATCHID!=
S.WATCHID;
viii. SELECT WATCHNAME, QTYSTORE, SUM (QTYSOLD), QTY_STORE - SUM (QTY_SOLD)
"STOCK" FROM WATCHES W, SALE S WHERE W. WATCHID = S.WATCHID GROUP BY
S.WATCHID;
OR
Consider the following tables. Write SQL commands for the statements (i) to (v).
TABLE: SENDER

SenderlD SenderName SenderAddress SenderCity

ND01 R Jair 2, ABC Appts New Delhi

MU02 H Sinha 12, Newtown Mumbai

MU15 S Jha 27/A, Park Street Mumbai

ND50 T Prasad 122-K, SDA New Delhi

TABLE: RECIPIENT

RecID SenderlD RecName RecAddress RecCity

KO05 ND01 R Bajpayee 5, Central Avenue Kolkata

ND08 MU02 S Mahajan 116, A Vihar New Delhi

MU19 ND01 H Singh 2A, Andheri East Mumbai

MU32 MU15 P K Swamy B5, CS Terminus Mumbai

ND48 ND50 S Tripathi 13, B1 D, Mayur Vihar New Delhi

i. To display the names of all Senders from Mumbai.


ii. To display the RecID, SenderName, SenderAddress, RecName, RecAddress for every Recipient.
iii. To display Recipient details in ascending order of RecName.
iv. To display number of Recipients from each City.
v. To display the detail of recipients who are in Mumbai.

You might also like