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

Class 12 Computer Science Sample Paper Set 7

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

Class 12 Computer Science Sample Paper Set 7

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/07 Set ~ 7
Roll No. Q.P Code 15/7/7
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. If the addition of a new key:value pair causes the size of the dictionary to grow beyond its original size, an error [1]
occurs.
2. Which of the following is not an aggregate function? [1]

a) Min b) With

c) Avg d) Sum
3. Which of the following is not a legal method for fetching records from database from within Python? [1]

a) fetchtwo( ) b) fetchall( )

c) fetchone( ) d) fetchmany( )
4. Select the correct output of the code: [1]

S= "Amrit Mahotsav @ 75"


A=S.partition (" ")
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]
d = {0: 'a', 1: 'b', 2: 'c'}
for x in d.values():
print (x, end = ' ')
6. Which data communication method is used to transmit the data over a serial communication link? [1]

a) All of these b) Simplex

c) Full duplex d) Half-duplex


7. To read the remaining lines of the file from a file object infi, we use [1]

a) nfi.read( ) b) infi.readlines( )

c) infi.read(all) d) infi.readline( )
8. Which of the following is not a character data type in SQL? [1]

a) VARCHAR1 b) VARCHAR

c) CHAR d) VARCHAR2
9. Consider the table with structure as: [1]
Student(ID, name, dept name, tot_cred)
Which attribute will form the primary key?

a) Dept b) ID

c) Total credits d) Name


10. Differentiate between the following: [1]
i. f = open('diary.txt', 'r')
ii. f = open('diary.txt', 'w')
11. State true or false: [1]
Variables can be assigned only once.
12. A pointer variable which contains the location of the first/topmost element of the stack is called ________. [1]

a) Final b) Top

c) Last d) First
13. In SQL, write the name of the aggregate function which will display the cardinality of a table. [1]
14. A ________ is a network spread across states, countries or whole world. [1]

a) PAN b) LAN

c) WAN d) MAN
15. Which of the following functions will return the string in all caps? [1]

a) toupper() b) to-upper()

c) isupper() d) upper()
16. Which of the following group functions ignore NULL values? [1]

a) MAX b) All of these

c) SUM d) COUNT
17. Computer communication signal which is in the form of the continuous wave is called [1]
a) modulation signal b) Binary signal

c) digital signal d) analog signal


18. Network in which every computer is capable of playing the role of a client, or a server, or both at the same time [1]
is called

a) wide area network b) dedicated server network

c) local area network d) peer-to-peer network


19. Assertion (A): String handling in Python is a straightforward task. [1]
Reason (R): Python does not provide built-in functions and operators to perform operations in the string.

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): The check_call() method of the module subprocess is used to execute a Python script and write [1]
the output of that script to a file.
Reason (R): In Python, there are requirements to write the output of a Python script to a 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): If you for some reason have a function definition with no content put in the pass statement to [1]
avoid getting an error.
Reason (R): Function definitions can be empty.

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. Wireless networks employ strategies to avoid collisions. Why can't they detect collisions? [2]
23. Following table represents information on sales representatives For Premiere Products and contains the [2]
Following data Fields for sales representations.

Sales representative's number SLSRNUMB

Sales representative's name SLSRNAME

Sales representative's address SLSRADDR

total commission paid to the sales representative TOTCOMM

Sales representative's commission rate COMMRATE

Write Python code to create the above table.


24. Write a program to print a square multiplication table as shown below: [2]

1 2 3 4 5 6 7 8 9

2 4 6 8 10 12 14 16 18

3 6 9 12 15 18 21 24 27
4 8 12 16 20 24 28 32 36

5 10 15 20 25 30 35 40 45

6 12 18 24 30 36 42 48 54

7 14 21 28 35 42 49 56 63

8 16 24 32 40 48 56 64 72

9 18 27 36 45 54 63 72 81

OR
What is the output of below questions?
l1 = [23, 45, 19, 77, 10, 22]
i. l1. sort ( )
ii. max(l1)
25. What are data types? What are the main objectives of datatypes? [2]
26. Find the error in following code. State the reason of the error. [2]
aLst = {'a' : 1, 'b' : 2, 'c' : 3}
print (aLst['a', 'b'])
OR
Observe the following tuple and answer the questions that follow:

t1 = (70, 56, 'Hello', 22, 2, 'Hi', 'The', 'World', 3)

i. t1 [2 : 4]
ii. t1 [- 6]
27. What are csv files? [2]
OR
Your recipe uses some ingredients. Write a program to store the list of ingredients in a binary file.
28. Differentiate between fruitful functions and non-fruitful functions. [2]
Section C
29. Write functions in Python for PushS(List) and for PopS(List) for performing Push and Pop operations with a [3]
stack of List containing integers. The function must check for Empty Stack.
OR
Write a function that takes a list that is sorted in ascending order and a number as argument. The function should do
the following:
i. Insert the number passed as argument in a sorted list.
ii. Delete the number from the list.
30. Consider the following table with their fields [3]
EMPLOYEE ( E_CODE, E_NAME, DESIG, SALARY, DOJ)
List the names, salary, PF, HRA, DA of all the employees in the EMPLOYEE table. HRA is 25% of salary and
DA is 10% of salary. PF is 5% of salary. The result should be in descending order of salary.
OR
Write the output of SQL queries (a) to (d) based on the table VACCINATION_DATA given below:
TABLE: VACCINATION_DATA
VID Name Age Dose1 Dose2 City

101 Jenny 27 2021-12-25 2022-01-31 Delhi

102 Harjot 55 2021-07-14 2021-10-14 Mumbai

103 Srikanth 43 2021-04-18 2021-07-20 Delhi

104 Gazala 75 2021-07-31 NULL Kolkata

105 Shiksha 32 2022-01-01 NULL Mumbai

a. SELECT Name, Age FROM VACCINATION_DATA


WHERE DOSE2 IS NOT NULL AND Age >40;
b. SELECT City, COUNT(*) FROM VACCINATION_DATA GROUP BY City;
c. SELECT DISTINCT CIEY EROM VACCINATION_DATA;
d. SELECT MAX (Dose1), MIN (Dose2) FROM VACCINATION_DATA;
31. Write the definition of a function Sum3(L) in Python, which accepts a list L of integers and displays the sum of [3]
all such 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
What are different types of arguments/parameters that a function can have?
Section D
32. Write Addnew(Book) and Remove(Book) methods in Python to Add a new Book and Remove a Book from a [4]
List of Books, considering them to act as PUSH and POP operations of the data structure stack.
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. God made the Earth; [4]
Man made confining countries
And their fancy-frozen boundaries.
But with unfound boundless Love
I behold the borderland of my India
Expanding into the World.
Hoil, mother of religions, Lotus, scenic beauty, and sages!
Consider the file "poemBTH.txt" and predict the outputs of following code fragments if the file has been opened
in filepointer file1 with code:
file1 = open("E :\\mydata\\poemBTH.txt", "r+")
i. print ("A. Output 1")
print(file1.read())
print()
ii. print("B. Output 2")
print(file1.readline())
print()
iii. print ("C. Output 3")
print(file1.read(9))
print()
iv. print ("D. Output 4")
print(file1.read(9))
print()
v. print("E. Output of Readlines function is")
print(file1.readlines())
print()
34. Consider the following tables CABHUB and CUSTOMER. Write SQL commands for the following statements. [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

i. To display the names of all the white colored vehicles.


ii. To display name of vehicle, make and capacity of vehicles in ascending order of their seating capacity.
iii. To display the highest charges at which a vehicle can be hired from CABHUB.
iv. To display the customer name and the corresponding name of the vehicle hired by them
OR
Give output for following SQL queries as per given table(s) for (i) to (v) and write sql commands for point (vi) and
(vii).
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

10017 FORMAL PANT 1350 F01 09-MAR-08

10020 FROCK 850 F04 09-SEP-07

10089 SLACKS 750 F03 31-OCT-08

Table: FABRIC

FCODE TYPE

F04 POLYSTER

F02 COTTON

F03 SILK

F01 TERELENE

i. SELECT SUM (PRICE) FROM GARMENT WHERE FCODE = 'F01';


ii. SELECT DESCRIPTION, TYPE FROM GARMENT, FABRIC
WHERE GARMENT.FCODE = FABRIC.FCODE AND GARMENT.PRICE >= 1260;
iii. SELECT MAX (FCODE) FROM FABRIC;
iv. SELECT COUNT (DISTINCT PRICE) FROM GARMENT;
v. To display GCODE and DESCRIPTION of each GARMENT in descending order of GCODE
vi. 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).
35. Consider table faculty in database EngColl with following structure. [4]
Id → Faculty id. (Primary Key)
lastname → Lastname of the faculty member
Firstname → Firstname of the faculty member
locationid → Location id of the member,
phone → Phone Number of the member,
rank → It can be either 'ASSO', 'FULL', ASST', 'INST'
startdate → date of joining of the member.
Write a Python code to update the rank of the member as 'FULL' for all the records whose data
of joining is before 31/3/1998.
Password of database is pwdfac, and userid is Fac_dep
Section E
36. What is switching techniques? Explain any two switching technique. [5]
37. Write SQL queries for (i) to (vii) on the basis of tables given below: [5]
Table: PRODUCTS

PID PNAME QTY PRICE COMPANY SUPCODE

101 DIGITAL CAMERA 14X 120 12000 RENBIX SOI

102 DIGITAL PAD l l i 100 22000 DIGI POP S02


104 PEN DRIVE 16 GB 500 1100 STOREKING SOI

106 LED SCREEN 32 70 28000 DISPEXPERTS S02

105 CAR GPS SYSTEM 60 12000 MOVEON S03

Table: SUPPLIERS

SUPCODE SNAME CITY

S01 GET ALL INC KOLKATA

S03 EASY MARKET CORP DELHI

S02 DIGI BUSY GROUP CHENNAI

i. To display the details of all the products in ascending order of product names (i.e., PNAME).
ii. To display product name and price of all those products, whose price is in the range of 10000 and 15000
(both values inclusive).
iii. To display the number of products, which are supplied by each supplier, i.e., the expected output should be;
S01 2
S02 2
S03 1
iv. To display the price, product name, and quantity (i.e., qty) of those products which have a quantity of more
than 100.
v. To display the names of those suppliers, who are either from DELHI or from CHENNAI.
vi. To display the name of the companies and the name of the products in descending order of company names.
vii. Obtain the outputs of the following SQL queries based on the data given in tables PRODUCTS and
SUPPLIERS above.
a. SELECT DISTINCT SUPCODE FROM PRODUCTS;
b. SELECT MAX (PRICE), MIN (PRICE) FROM PRODUCTS;
c. SELECT PRICE*QTY FROM PRODUCTS WHERE PID = 104;
d. SELECT PNAME, SNAME FROM PRODUCTS P, SUPPLIERS S WHERE P. SUPCODE = S.
SUPCODE AND QTY >100;
OR
Consider the following tables WORKER and PAYLEVEL and answer the following parts of this question :
Table : WORKER

ECODE NAME DESIG 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-2009 14-Oct-1983

15 Ameen Ahmed Mechanic P002 21-Aug-2006 13-Mar-1984

18 Sanya Clerk P002 19-Dec-2005 09-Jun-1983

Table : PAYLEVEL

PLEVEL PAY ALLOWANCE


P001 26000 12000

P002 22000 10000

P003 12000 6000

Give the output of the following SQL queries:


i. SELECT COUNT (PLEVEL), PLEVEL FROM WORKER GROUP BY PLEVEL;
ii. SELECT MAX(DOB), MIN(DOJ) FROM WORKER;
iii. SELECT Name, Pay FROM WORKER W, PAYLEVEL P
WHERE W.PLEVEL = P.PLEVEL AND W.ECODE < 13;
iv. SELECT PLEVEL, PAY + ALLOWANCE FROM PAYLEVEL WHERE PLEVEL = 'P003';

You might also like