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

Class 12 Computer Science Sample Paper Set 4

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)
75 views

Class 12 Computer Science Sample Paper Set 4

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/ 12

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/04 Set ~ 4
Roll No. Q.P Code 15/4/4
Candidates must write the Q.P Code
on the title page of the answer-book.

 Please check that this question paper contains 08 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]
A dictionary can contain keys of any valid Python types.
2. Which of the following command is used to remove the table definition and all data? [1]

a) Choose b) Drop

c) Create d) Select
3. User can write Python script using [1]

a) SQL.connect library b) MySQL.connector library

c) MySQL.connect library d) MySQL.connect library


4. Select the correct output of the code: [1]

S="Amrit Mahotsav @ 75"


A=S.split(" ",2)
print(A)

a) ('Amrit', 'Mahotsav', '@ 75') b) ['Amrit', 'Mahotsav', '@', '75']

c) ['Amrit', 'Mahotsav', '@ 75'] d) ('Amrit', 'Mahotsav', '@', '75')


5. What is the output of the following? [1]
dry = {0: 'a', 1: 'b', 2: 'c'}
for x, y in dry. items():
print(x, y, end = ' ')
6. Find EVEN parity bit for 10010001 [1]

a) 1 b) 3

c) 2 d) 0
7. For readline(), a line is terminated by [1]

a) 'n\' b) '\n'

c) EOF d) Either '\n' or EOF


8. fetchone() method fetches only one row in a ResultSet and returns a ________. [1]

a) String b) Tuple

c) Dictionary d) List
9. Which operator tests the column for the absence of data (i.e., NULL value)? [1]

a) IS NULL operator b) NOT operator

c) IS EMPTY operator d) EXISTS operator


10. Consider a file "contacts.txt" which contains name and phone number. Figure out what the following code is [1]
trying to do :
name = input ("Enter name :")
file = open("contacts.txt", "r")
for line in file:
if name in line:
print(line)
11. State true or false: [1]
Variables that are listed within the parentheses of a function header are called function variables.
12. ________ is the term used to delete an element from the stack. [1]

a) Push b) Pop

c) Pump d) Pull
13. Write an SQL statement to create a PRIMARY KEY constraint on the "P_Id" column of table Persons, when the [1]
table is already created.
14. A ________ is a network point that acts as an entrance to another network. [1]

a) Hub b) Repeater

c) Gateway d) Bridge
15. Which of the following operator cannot be used with string data type? [1]

a) * b) in

c) / d) +
16. A relational database consists of a collection of ________. [1]

a) Attributes b) Tuples
c) Keys d) Relations
17. Which of the following is not the possible ways of data exchange? [1]

a) Multiplex b) Simplex

c) Half-duplex d) Full-duplex
18. Frequency is measured in [1]

a) Both Cycles per second and Hertz b) per second Hertz

c) Cycles per second d) Hertz


19. Assertion (A): Python is an interpreted language. [1]
Reason (R): Python can perform complex tasks using a few lines of code.

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): In the case of rb mode, the file pointer exists at the beginning of the file. [1]
Reason (R): In the case of rb+ mode, the file pointer exists at the end of the file.

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): A python callable() function in Python is something that can be called. [1]
Reason(R): The python compile() function takes source code as input and returns a code object which can later
be executed by the exec() function.

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 is collision in a network? How does it impact the performance of a network? [2]
23. Differentiate between CHAR and VARCHAR data types. [2]
24. Define any two exception classes which are used in Python. [2]
OR
Observe the following tuples and answer the questions that follow.

t1= (4, 7, 8, 9)
t2=(0, 4, 3)

i. >>>t=t1+t2
>>>print(t)
ii. >>>t=t1*t2
>>>print(t)
25. Consider the table MobileStock with following fields [2]
M_Id, M_Name, M_Qty, M_Supplier
Write the Python code to fetch all records with fields M_Id, M_Name and M_Supplier from database Mobile.
26. Find the errors. State reasons. [2]
for Name in [Amar, Shveta, Parag]
IF Name[0] = 'S' :
print(Name)
OR
Explain the term bubble sorting.
27. Considering the following definition of dictionary MULTIPLEX, write a method in python to search and display [2]
all the content in a pickled file CINEMA.DAT, where MTYPE key of the dictionary is matching with the value
'Comedy'.
MULTIPLEX = {'MNO' : ________, 'MNAME' : ________, 'MTYPE' : ________}
OR
Write a function in Python to count the number of lowercase and uppercase characters in a text file "Book.txt".
28. How can we import a module in Python? [2]
Section C
29. Explain the use of global keywords used in a function with the help of a suitable example. [3]
OR
Write definition of a method EvenSum(NUMBERS) to add those values in the list of NUMBERS, which are not odd.
30. Tanya Khanna is using a table Employee. It has the following columns: [3]
Admno., Name, Agg, Stream
[column Agg contains Aggregate marks]
She wants to display highest Agg obtained in each Stream.
She wrote the following statement :
SELECT Stream, MAX(Agg) FROM Employee ;
But she did not get the desired result. Rewrite the above query with necessary changes to help her get the desired
output.
OR
How to create a database?
31. Write a function that takes a sorted list and a number as an argument. Search for the number in the sorted list [3]
using binary search.
OR
Find the errors in code given below:
i. def minus(total, decrement)
output = total - decrement
print(output)
return (output)
ii. define check()
N = input ('Enter N:')
i=3
answer = 1 + i * * 4/N
Return answer
iii. def alpha(n, string = 'xyz', k = 10) :
return beta(string)
return n
def beta (string)
return string == str(n)
print(alpha("Valentine's Day"):)
print(beta (string = 'true'))
print(alpha(n=5, "Good-bye") :)
Section D
32. Write a program to implement a stack for these book details (book no., book name). That is, now each item node [4]
of the stack contains two types of information - a book no. and its name. Just implement Push and display
operations.
OR
Write the Push operation of stack containing person names. Notice that the name should only accept characters,
spaces and period (.) except digits. Assume that Pname is a class instance attribute.
33. Write one difference between CSV and text files. [4]
Write a program in Python that defines and calls the following user defined functions:
i. COURIER_ADD () : It takes the values from the user and adds the details to a csv file 'courier.csv'. Each
record consists of a list with field elements as cid, s name, Source, destination to store Courier ID, Sender
name, Source and destination address respectively.
ii. COURIER_SEARCH () : Takes the destination as the input and displays all the courier records going to that
destination.
34. What do you understand by Candidate Keys in a table? Give a suitable example of Candidate keys from a table [4]
containing some meaningful data.
OR
Give output for following SQL queries as per given table(s) :
Table: Books

Book_Id Book_Name Author_Name Publishers Price Type Qty.

C0001 Fast Cook Lata Kapoor EPB 355 Cookery 5

F0001 The Tears William Hopkins First Publ. 650 Fiction 20

T0001 My First C++ Brian and Brooke EPB 350 Text 10

T0002 C++ Brainworks A.W. Rossaine TDH 350 Text 15

F0002 Thunderbolts Anna Roberts First Publ. 750 Fiction 50

Table: Issued

Book_Id Quantity_Issued

T0001 4

C0001 5

F0001 2

i. SELECT COUNT() FROM Books;


ii. SELECT MAX(Price) FROM Books WHERE Quantity >= 15;
iii. SELECT Book_Name, Author_Name FROM Books WHERE Publishers = "EPB";
iv. SELECT COUNT (DISTINCT Publishers) FROM Books WHERE Price >= 400;
35. Write a program that inputs the main string and then creates an encrypted string by embedding a short symbol- [4]
based string after each character. The program should also be able to produce the decrypted string from an
encrypted string.
Section E
36. Ayurveda Training Educational Institute is setting up its Centre in Hyderabad with three specialized departments [5]
for Orthopaedics, Neurology and Paediatrics along with an administrative office in separate buildings. The
physical distances between these department buildings and the member of computers to be installed in these
departments and administrative offices are given as follows. You, as a network expert have the shortest distances
between various locations in meters:

Administrative office to Orthopaedics unit 55

Neurology unit to Administrative office 30

Orthopedics unit to Neurology unit 70

Paediatrics unit to Neurology unit 50

Pediatrics unit to Administrative office 40

Paediatrics unit to Orthopaedics unit 110

The number of Computers installed at the various location is as follows:

Paediatrics unit 40

Administrative office 140

Neurology unit 50

Orthopedics unit 80

i. Suggest the most suitable location for the main server of this institution to get efficient connectivity.
ii. Suggest the cable layout for effective network connectivity of the building having a server with all the other
buildings.
iii. Suggest a device to be installed in each of these building for connecting computers installed within the
building out of the following:
Gateway
Modem
Switch
iv. Suggest the topology of the network and network cable for efficiently connecting in each of the building one
of the following: Topologies: Bus Topology, Star Topology, Network Cable: Single Pair Telephone Cable,
Coaxial Cable, Ethernet Cable.
37. Write SQL queries for (i) to (iv) and find outputs for SQL queries (v) to (viii), Which are based on the table. [5]
Table: CUSTOMER
CNO CNAME ADDRESS

101 Richa Jain Delhi

102 Surbhi Sinha Chennai

103 Lisa Thomas Bangalore

104 Imran Ali Delhi

105 Roshan Singh Chennai

Table: TRANSACTION

TRNO CNO AMOUNT TYPE DOT

T001 101 1500 Credit 2017-11-23

T002 103 2000 Debit 2017-05-12

T003 102 3000 Credit 2017-06-10

T004 103 12000 Credit 2017-09-12

T005 101 1000 Debit 2017-09-05

i. To display details of all transactions of TYPE Credit from Table TRANSACTION.


ii. To display the CNO and AMOUNT of all Transactions done in the month of September 2017 from table
TRANSACTION.
iii. To display the last dale of transaction (DOT) front the table TRANSACTION for the customer having CNO
as 103.
iv. To display all CNO CNAME and DOT (date of transaction) of those CUSTOMERS fron, tables
CUSTOMER and TRANSACTION who have done transactions more than or equal to 2000.
v. SELECT COUNT(*), AVG (AMOUNT) FROM TRANSACTION WHERE DOT > = '2017-06-01'
vi. SELECT CNO, COUNT(*), MAX (AMOUNT) FROM TRANSACTION GROUP BY CNO HAVING
COUNT (*)> 1
vii. SELECT CNO, CNAME FROM CUSTOMER WHERE ADDRESS NOT IN ('DELHI', BANGALORE )
viii. SELECT DISTINCT CNO FROM TRANSACTION
OR
Consider the following table GAMES. Write SQL commands for the following statements.
Table: GAMES

GCode GameName Type Number PrizeMoney ScheduleDate

101 Carom Board Indoor 2 5000 23-Jan-2004

102 Badminton Outdoor 2 12000 12-Dec-2003

103 Table Tennis Indoor 4 8000 14-Feb-2004

105 Chess Indoor 2 9000 01-Jan-2004

108 Lawn Tennis Outdoor 4 25000 19-Mar-2004

i. To display the name of all GAMES with their GCodes.


ii. To display details of those GAMES which are having PrizeMoney more than 7000.
iii. To display the content of the GAMES table in ascending order of ScheduleDate.
iv. To display sum of PrizeMoney for each Type of GAMES.

You might also like