0% found this document useful (0 votes)
105 views13 pages

Class 12 Computer Science Sample Paper Set 6

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 (0 votes)
105 views13 pages

Class 12 Computer Science Sample Paper Set 6

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

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

 Please check that this question paper contains 09 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 given object may appear in a list more than once.
2. Consider the following query : [1]
SELECT name, instructor name, course_id FROM instructor;
To display the field heading course with a different heading as id, which keyword must be used here to rename
the field name?

a) From b) Join

c) As d) Rename
3. Which method returns the next row from the result set as tuple? [1]

a) fetchone() b) rowcount

c) fetchall() d) fetchmany()
4. What is the output of the functions shown below? [1]
float('-infinity')
float('inf')

a) -infinity and inf b) Error and Error

c) -inf and inf d) Error and Junk value


5. What will be the output of the following code snippet? [1]
dc1 = { }
dc1[1] = 1
dc1['1'] = 2
dc1[1.0] = 4
sum = 0
for k in dc1:
sum += dc1[k]
print (sum)
6. Which of the following is the fastest media of data transfer? [1]

a) Fibre Optic b) Telephone Lines

c) Untwisted Wire d) Co-axial Cable


7. Suppose the content of a text file “Rhymes.txt” is as follows [1]
Jack & Jill
went up the hill
What will be the output of the following Python code?
F = open(“Rhymes.txt”)
L = F.readlines()
for i in L:
S=i.split()
print(len(S),end="#")

a) 2# b) 7#

c) 3#4# d) 2#4#
8. l1 = [1,2,3,4,5] [1]
l1.append([5,6,[7,8,[9,10])
What will be the final length of l1?

a) 10 b) 5

c) 8 d) Error
9. Which of the following is an advantage of SQL? [1]

a) Client/server language b) High speed

c) All of these d) Easy to learn


10. What does the rmdir() method do? [1]
11. State true or false: [1]
In Python, the program execution begins with first statement of _main_ segment.
12. What data structure is internally used for implementation of a recursive algorithm? [1]

a) Linked List b) Queue

c) Stack d) Tree
13. Name any two DDL and any two DML commands. [1]
14. Fill in the blank : [1]
In ________ switching, before a communication starts, a dedicated path is identified between the sender and the
receiver.

a) Circuit b) Packet

c) Plot d) Graph
15. Which of the following errors will result the abnormal termination of program? [1]

a) Semantic b) Run-time

c) Syntax d) Compile-time
16. Consider the following SQL statement. What type of statement is this? [1]
SELECT * FROM employee

a) DDL b) DCL

c) Integrity constraint d) DML


17. Which of the following is a client-side scripting language? [1]

a) Perl b) PHP

c) VB Script d) Ruby
18. A combination of bus and star topologies is called a ________ topology. [1]

a) Mesh b) Combination

c) Hybrid d) Tree
19. Assertion (A): Python is a multipurpose programming language [1]
Reason (R): Python can be used with web, enterprise, 3D CAD, etc.

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 w+, it overwrites the previous file if one exists. [1]
Reason (R): In the case r+, it doesn't overwrite the previous file if one exists.

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): If you want to change a decimal number into a percentage value, then you use format(). [1]
Reason (R): The format() function formats a specified value into a specified format.

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. Explain any two switching techniques used in networking. [2]
23. Write Python code to delete all the records from the Employee table whose age >60 the table has following [2]
fields.
Empid, EmpName, Deptid, age, Payscale
24. How to access the tuple? [2]
OR
What is meant by insertion sort?
25. Given a database Inventory, userid- store_manager password - WeIcometostore123 [2]
Write Python code to connect to the above database.
26. Determine which of the arithmetic expressions are valid. If invalid, explain the reason, [(a, b, c) are integers, (p, [2]
q, r) are float and (x, y, z) are float].
i. p/q + a - c
ii. q(a + b - z/4)
iii. p/q + a - c
iv. x/y + p* a/b
v. a* + b
vi. a + b*c*2
OR
Predict the output of the following program.

a = 5
b = a = 15
c = (a < 15)
print ("a =", a)
print ("b =", b)
print ("c =", c)

27. What would be the data type of variable data in following statements? [2]
i. data = f.read()
ii. data = f.read(10)
iii. data = f.readline()
iv. data = f.readlines()
OR
Consider a binary file Employee.dat containing details such as empno:ename:salary (separator ':'). Write a Python
function to display details of those employees who are earning between 20000 and 40000. (Both values inclusive)
28. Write a function to calculate volume of a box with appropriate default values for its parameters. Your function [2]
should have the following input parameters:
i. Length of box
ii. Width of box
iii. height of box
Section C
29. Write a function which takes two string arguments and returns the string comparison result of the two passed [3]
strings.
OR
Write functions in Python for InsertQ(Names) and RemoveQ(Names) for performing insertion and removal
operations with a queue of list which contains names of students. The function must check for Empty Queue.
30. Write the output of the SQL queries (a) to (d) based on the table TRAVEL given below: [3]
Table: TRAVEL

T_ID START END T_DATE FARE

101 DELHI CHENNAI 2021-12-25 4500

102 DELHI BENGALURU 2021-11-20 4000

103 MUMBAI CHENNAI 2020-12-10 5500

104 DELHI MUMBAI 2019-12-20 4500

105 MUMBAI BENGALURU 2022-1-15 5000

a. SELECT START, END FROM TRAVEL


WHERE FARE <= 4000;
b. SELECT T_ID, FARE FROM TRAVEL
WHERE T_DATE LIKE '2021-12-%';
c. SELECT T_ID, T_DATE FROM TRAVEL WHERE END = 'CHENNAI'
ORDER BY FARE;
d. SELECT START, MIN(FARE)
FROM TRAVEL GROUP BY START;
OR
Differentiate between the terms Attribute and Domain in the context of Relational Data Model.
31. Consider a function with following header: [3]
def info(object, spacing = 10, collapse = 1)
Here are some function calls given below. Find out which of these are correct and which of these are incorrect
stating reasons?
For correct function call statements, specify the argument values too.
i. info(obj1)
ii. info(spacing=20)
iii. info(obj2, 12)
iv. info(obj11, object = obj12)
v. info(obj3, collapse = 0)
vi. info( )
vii. info(collapse = 0, obj3)
viii. info( spacing = 15, object = obj4)
OR
Write the term suitable for following descriptions:
i. A name inside the parentheses of a function header that can receive value.
ii. An argument passed to a specific parameter using the parameter name.
iii. A value passed to a function parameter.
iv. A value assigned to a parameter name in the function header.
v. A value assigned to a parameter name in the function call.
vi. A name defined outside all function definitions.
vii. A variable created inside a function body.
Section D
32. Each node of a STACK contains the following information : [4]
i. Pin code of a city,
ii. Name of the city.
Write a program to implement the following operations in the above stack
i. PUSH( ) To push a node into the stack.
ii. POP( ) To remove a node from the stack.
OR
Write a function to push any student's information to stack.
33. Consider the file p2.txt created above. Now predict the output of following code that works with p2.txt. Explain [4]
the reason behind this output.
fp1 = open("p2.txt", "r")
print(fp1.readline(20))
s1 = fp1.readline(30)
print(s1)
print(fpl.readline(25))
34. Write SQL queries for (a) to (d) based on the tables CUSTOMER and TRANSACT given below: [4]
Table : CUSTOMER

CNO NAME GENDER ADDRESS PHONE

1001 Suresh MALE A-123, West Street 9310010010

1002 Anita FEMALE C-24, Court Lane 9121211212

1003 Harjas MALE T-1, Woods Avenue 9820021001

Table : TRANSACT

TNO CNO AMOUNT TTYPE TDATE

T1 1002 2000 DEBIT 2021-09-25

T2 1003 1500 CREDIT 2022-01-28

T3 1002 3500 CREDIT 2021-12-31

T4 1001 1000 DEBIT 2022-01-10

a. Write the SQL statements to delete the records from table TRANSACT whose amount is less than 1000.
b. Write a query to display the total AMOUNT of all DEBITs and all CREDITs.
c. Write a query to display the NAME and corresponding AMOUNT of all CUSTOMERs who made a
transaction type (TTYPE) of CREDIT.
d. Write the SQL statement to change the Phone number of customer whose CNO is 1002 to 9988117700 in the
table CUSTOMER.
OR
Give output for following SQL queries as per given table :
Table : LAB

No. ItemName CostPerltem Quantity DateofPurchase Warranty Operational

1. Computer 60000 9 21/5/96 2 7


2. Printer 15000 3 21/5/97 4 2

3. Scanner 18000 1 29/8/98 3 1

4. camera 21000 2 13/6/96 1 2

5. Hub 8000 1 31/10/99 2 1

6. UPS 5000 5 21/5/96 1 4

7. Plotter 25000 2 11/1/2000 2 2

i. SELECT MIN(DISTINCT Quantity) FROM LAB;


ii. SELECT MIN(Warranty) FROM LAB WHERE Quantity = 2;
iii. SELECT SUM(CostPerltem) FROM LAB WHERE Quantity > 2;
iv. SELECT AVG(CostPerltem) FROM LAB WHERE DateofPurchase < {1/1/99};
35. Create following table using Python code where [4]
Database - Test
Table - Watches
User name - Root
Password - System

Watchld WatchName Price Type Qtystore

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

Section E
36. Be Happy Corporation has set up its new centre at Noida, Uttar Pradesh for its office and web-based activities. It [5]
has 4 blocks of buildings.

Distance between the various blocks is as follows

A to B 40 m

B to C 120 m

C to D 100 m

A to D 170 m

B to D 150 m

A to C 70 m
Numbers of computers in each block
Block A - 25
Block B - 50
Block C - 125
Block D - 10
i. Suggest and draw the cable layout to efficiently connect various blocks of buildings within the Noida centre
for connecting the digital devices.
ii. Suggest the placement of the following device with justification
a. Repeater
b. Hub/Switch
iii. Which kind of network (PAN/LAN/WAN) will be formed if the Noida office is connected to its head office
in Mumbai?
iv. Which fast and very effective wireless transmission medium should preferably be used to connect the head
office at Mumbai with the centre at Noida?
37. Write SQL queries for (i) to (iv) and find outputs for SQL queries (v) to (viii), which are based on the tables: [5]
TABLE: BOOK

Code BNAME TYPE

F101 The Priest Fiction

L102 German easy Literature

C101 Tarzan in the lost world Comic

F102 Untold story Fiction

C102 War heroes Comic

TABLE: MEMBER

MNO MNAME CODE ISSUEDATE

M101 RAGHAV SINHA LI 02 2016-10-13

M103 S ARTHAKJ OHN FI 02 2017-02-23

M102 ANISHA KHAN C101 2016-06-12

i. To display all details from table MEMBER in descending order of ISSUEDATE.


ii. To display the BNO and BNAME of all Fiction Type books from the table Book.
iii. To display the TYPE and number of books in each TYPE from the table BOOK.
iv. To display all MNAME and ISSUEDATE of those members from table MEMBER who have books issued
(i.e., ISSUEDATE) in the year 2017.
v. SELECT MAX (ISSUEDATE) FROM MEMBER
vi. SELECT DISTINCT TYPE FROM BOOK
vii. SELECT A.CODE, BNAME, MNO. MNAME FROM BOOK A. MEMBER B WHERE A.CODE=
B.CODE
viii. SELECT BNAME FROM BOOK WHERE TYPE NOT IN ("FICTION", "COMIC")
OR
Consider the following tables GARMENT and FABRIC. Write SQL commands for the statements (i) to (v).
TABLE: GARMENT

GCODE DESCRIPTION PRICE FCODE READYDATE

10023 PENCIL SKIRT 1150 F03 19-DEC-08

10001 FORMAL SHIRT 1250 F01 12-JAN-08

10012 INFORMAL SHIRT 1550 F02 06-JUN-08

10024 BABY TOP 750 F03 07-APR-07

10090 TULIP SKIRT 850 F02 31-MAR-07

10019 EVENING GOWN 850 F03 06-JUN-08

10009 INFORMAL PANT 1500 F02 20-OCT-08

10007 FORMAL PANT 1350 F01 09-MAR-08

10020 FROCK 850 F04 09-SEP-07

10089 SLACKS 750 F03 20-OCT-08

TABLE: FABRIC

FCODE TYPE

F04 POLYSTER

F02 COTTON

F03 SILK

F01 TERELENE

i. To display GCODE and DESCRIPTION of each GARMENT in descending order of GCODE.


ii. To display the details of all the GARMENTS, which have READYDATE in between 08-DEC-07 and 16-JUN-08
(inclusive of both the dates).
iii. To display the average PRICE of all the GARMENTS. Which are made up of FABRIC with FCODE as F03.
iv. To display FABRIC wise highest and lowest price of GARMENTS from GARMENT table. (Display FCODE of
each GARMENT alongwith highest and lowest price.)
v. To display garment’s description with their price whose fabric is silk.

You might also like