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

CS-PB- Sample Paper

This document is a sample question paper for Class XII Computer Science for the academic year 2024-25, consisting of multiple-choice questions, short answer questions, and programming tasks. It covers various topics including Python programming, database management, and data structures. The paper is structured into sections with a total of 70 marks and includes both theoretical and practical components.

Uploaded by

Namita
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

CS-PB- Sample Paper

This document is a sample question paper for Class XII Computer Science for the academic year 2024-25, consisting of multiple-choice questions, short answer questions, and programming tasks. It covers various topics including Python programming, database management, and data structures. The paper is structured into sections with a total of 70 marks and includes both theoretical and practical components.

Uploaded by

Namita
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

SAMPLE PAPER 2024-25

CLASS: XII Time allowed: 3 Hours Maximum Marks:70


COMPUTER SCIENCE (083-THEORY)

Q Section-A (21x1=21Marks) Marks


No.
1. State-True or false:
Python interpreter handles logical errors during code execution. (1)
2. (A)Which of the following will return False:
(B)A) not (True and False) B) True or False (1)
(C)C) not (True or False) D) not (True and False)
3. (A)Which of the following function will help in converting a string to list with
elements separated according to delimiter passed? (1)
(D) A) list( ) B) split( ) C) str( ) D) shuffle( )
4. What is the output of the following?
OCEANS=('pacific','arctic','Atlantic','southern') (1)
print(OCEANS[4])
A) ‘southern’ B) (‘southern’) C) Error D) INDEX
5. What is the output of the following (1)
x="Excellent day"
print(x[1::3])
A) x B) xlnd C) error D) dnlx
6. What can be the possible output of the following code:
def Element(x):
z=""
for y in x:
if not y.isalpha():
z=z+z.join(y) (1)
print(z)
Element("W2e0Py2th4n") #Function Call
A) 2 B) 02 C) 024 D) 2024
7. If D={‘Mobile’:10000, ‘Computer’:30000, ‘Laptop’:75000} then which of the
following command will give output as 30000
A) print(D) B) print(D['Computer'])
C) print(D.values( )) D)print(D.keys( )) (1)
8. Which of the following is not correct?
(A) del deletes the list or tuple from the memory
(B) remove deletes the list or tuple from the memory (1)
(C) pop is used to delete an element at a certain position
(D) pop(<index>) and remove(<element>) performs the same operation
9. A relation in a database can have _____ number of primary key(s)?
A) 1 B) 2 C) 3 D) 4 (1)
10. What is the value of ‘p’ and how many characters will be there in the variable
‘data’ in the following statement (1)
with open ("lists.txt","r",encoding="utf-8") as
F:
data = F.read(100)
p=F.seek(10,0)
print(p)
A) 10, 100 B) 100, 10 C) 10, 110 D)
110, 10
1
11. Write the name of block / command(s) can be used to handle the error/exception (1)
in Python.
12. What will be the output of the following code?
def add():
c=1
d=1
while(c<9):
c=c+2 (1)
d=d*c
print(d, end="$")
return c
print(add( ),end="*")

A) 945$9* B) 945$9 C) 9*945$ D) 9$945*


13. Which type of command is used to delete the structure of the relation? (1)
A) DDL B) DML C) Select D) Cannot delete structure
14. What will the following query show?
(considering a table student with some columns)
SELECT * FROM students WHERE age in (17,19,21);
A) Show tuples of students table with all the age values from 17 to 21 (1)
B) Show tuples of students table only with the age values 17,19,21
C) Show tuples of students table only with the age values other then 17,19,21
D) Show tuples of students table with all the age values outside the range 17 to 21
15. Which of the following is not a data type in Python
A) date B) string C) tuple D) (1)
float
16. Which of the following is not an aggregate function?
A) max( ) B) count( ) C) sum( ) D) (1)
upper( )
17. Which of the following protocol helps in e-mail services?
A) FTP B) PPP C) UDP D) MIME (1)
18. In order to cover a long-distance network which of the following device will be (1)
helpful?
A) Modem B) Gateway C) Switch D) Repeater
19. What is SIM & GPRS? (1)
A) Small Information Machine & Global People Research and Science
B) Subscriber Identity Module & General Packet Radio Service
C) Subscriber Information Module & General Public Radio Shrive
D) None of these
Q20 and Q21 are Assertion(A) and Reason(R) based questions. Mark the correct choice as:
A) Both A and R are true and R is the correct explanation for A
B) Both A and R are true and R is not the correct explanation for A
C) A is True but R is False
D) A is False but R is True

20. Assertion(A): In a relation of RDBMS, redundancy can be reduced.


Reasoning (R): This can be done with the help of join operations in between
relation. (1)
21. Assertion (A): A function in Python can have any number of arguments.
Reasoning(R): variable length parameter can be used to deal with such number
of arguments. (1)
2
Q No Section-B (7x2=14 Marks) Marks
22. a) Explain dictionary with example?
b) What is the data type of (i) x=10 (ii) x=10,20 (2)
23. Explain ‘in’ operator and write a small code in Python to show the use of ‘in’ (2)
operator.
24. Consider T=(10,20,30) and L=[60,50,40] answer the question I and II (1)
(I) Write command(s) to add tuple T in list L.
OR
Write command to find and delete element 20 from tuple T
(II) Write command to add 50 in L at position 2. (1)
OR
Write command to delete the variable T.
25. Identify the correct output(s) of the following code and write the minimum and
the maximum possible values of the variable b.
import random
a="ComputerScience"
I=0
while (I<3):
b=random.randint(1,len(a)-1) (2)
print(a[b],end='$')
I+=2

A) C$m$ B) m$p$ C) c$n$ D)c$e$c$


26. Write a function named RECORDS() which can open a binary file named
‘district.dat’ containing the population data of all the districts of a state. The
function will ask for the name of the district to be searched in file and display its (2)
data from the file. [Note: Name of dist. is stored at 0 index of record in
district.dat]
27. [I]
A) Benjamin a database administrator created a table with few columns. He
wants to stop duplicating the data in the table. Suggest how he can do so.
OR
B) Consider two tables student (rno, name, class) and marks (rno, mrk_obt,
percent). You as a database administrator how will your stop redundancy
of data in the table students and how the tables students and marks can be
connected with each other (2)
[II]
A) Write an SQL command to change the data type of a column named price
to number (10,2) in a table named stationary
OR
B) Write an SQL command to change the values of all the rows of the
column
price of table stationary to Null
28. A) Difference between star and mesh topology.
OR (2)
B) Write the full forms of (i) VoLTE (ii) GSM

Q Section-C(3x3=9Marks) Marks
No.
29. A) Write a Python function that displays all the words starting from the letter
3
‘C’ in the text file "chars.txt".
OR (3)
B)Write a Python function that can read a text file and print only numbers
stored in the file on the screen (consider the text file name as "info.txt").
30. A) You have a stack named Inventory that contains records of medicines. Each
record is represented as a list containing code, name, type and price.
Write the following user-defined functions in Python to perform the
specified operations on the stack Inventory:
i. New_In (Inventory, newdata): This function takes the stack Inventory
and newdata as arguments and pushes the newdata to Inventory stack.
ii. Del_In(Inventory): This function removes the top most record from the
stack and returns it. If the stack is already empty, the function should
display "Underflow".
iii. Show_In(Inventory): This function displays the topmost element of the (3)
stack without deleting it. If the stack is empty, the function should
display 'None'.
OR
B) Write the definition of a user-defined function `Push(x)` which accepts a
string in parameter `x` and pushes only consonants in the string `N` into a Stack
named `Consonants`.
Write function Display () to display all element of the stack.

For example: x = “Python”


Then the stack `Consonants’ should store: [‘P’,’y’,’t’,’h’,’n’]
31. Predict the output of the following code:
d={}
V="programs"
for x in V: (3)
if x in d.keys():
d[x]=d[x]+1
else:
d[x]=1
print(d)
OR
Predict the output of the following code:
V="interpreter"
L=list(V)
L1=""
for x in L:
if x in ['e','r']:
L1=L1+x
print(L1)

Q Section-D( 4x4=16Marks) Mar


No. ks
32. Consider the tables given below
Watches
Id Wname Price Type Qty
W01 High Time 1200 Common 75
W02 Life line 1600 Gents 150
W03 Wave 780 Common 240
W04 Timer 950 Gents 460
W05 Golden era 1760 Ladies 250
4
(4)
WSale
Wid QSold Qtr
W01 25 1
W02 23 1
W03 2 1
W04 10 2
W05 12 2
W03 22 3
W04 22 3
W02 23 3

“Note: Consider the table contains the above records.”


A) Write the queries for the following:
i) To display the total quantity sold (qsold) of wsale for qtr number 3.
ii) To display the details of watches in descending order of qty.
iii) To display the total quantity of watches.
iv) To display the wname and maximum qsold from the table watches and
wsale sold in qtr=1
OR
B) Write the output
i) Select sum(price) from watches;
ii) Select * from watched where wname '%e';
iii) Select sum(qty), type from watches group by type;
iv) Select wname, price, qtr from watches, wsold
where watches.id = wsale.wid and watches.type=’Common’;
33. A csv file "candidates.csv" contains the data collected from an online application form
for selection of candidates for different posts, with the following data
● Candidate Name
● Qualification (4)
● Percent_XII
● Percent_Qualification
E.g. [‘Smith Jones’, ‘M Tech’, 80, 76]
Write the following Python functions to perform the specified operations on this file:
a) READ() function which can read all the data from the file and display only records
with Percent_XII more than 75
b) IDENTIFY() function which can find and print the number of such records which
are having Percent_XII not more than 75
34. A school is maintaining the records of his departments and their in-charges in the
following table and wants to see the data according to the following conditions. Study
the following table and write the queries for (i) to (iii) and output for (iv)

Table: Departments

D_No D_name D_Incharge Date_join grant


D94 Physics Binny 12-10-2021 34000
D46 Chemistry Virat 24-12-2010 49500
(4)
D78 Biology Jimmy 10-05-2001 79000
D99 Geography Adams 05-09-2006 62000
D23 Primary Ajay 15-06-2009 Null

(i) To display complete details of those departments where date_join is less then
5
01-01-2010
(ii) To display the details of departments with the name of incharges containing
m in their name.
(iii) To increase the grant of department by 1200 of D_no either D99 or D23.
(iv) Select d_name, grant from department where grant is null;
OR
Select sum(grant) from department where date_join>’10-10-2020’;
35. Consider a database named ‘DB’ containing a table named ‘Vehicle’ with the
following structure
Field Type
Model char(10)
Make_year Int(4)
Qty Int(3) (4)
Price Number(8,2)

Write the following Python function to perform the following operation as mentioned:
1. Add_Vehicle() - which takes input of data and store it to the table
2. Search_vehicle() – which can search a model given by user and show it on screen
* Assume the following for Python – Database connectivity:
Host: localhost, User: root, Password: root
Q. SECTIONE(2X5=10 Marks) Mar
No. ks
36. Rajiv Kumar is an owner of a company willing to manage the data of his office
employees like their biodata, salary centrally for all his offices located in the state of
Karnataka.
He planned to make a database named ‘company’ with the table ‘staff’ that contains
following structure
- ID–integer(4)
- Name–string(30)
- Designation–string(10)
- Birth_date–date
- Salary-decimal(10,2)

You as his database administrator write the following queries (I) to (IV)

(I) Create a table ‘staff’ with above structure and id as primary key. (2)
(II) Display all the records with designation ‘Sales Executive’ (1)
(III) To change the designation = ‘Assistant’ of all the staff having salary from (1)
15000 to 17000 (both values included)
(IV) To display the total number of records with name ending at letter ‘j’ (1)
37. PK International is an advertising agency who is setting up a new office in Gurgaon in
an area of 2.5 kms with four building Admin, Finance, Development, Organizers. You
have been assigned the task to suggest network solutions by answering the following
questions (i) to (v)

No. of computers in the building Distance between buildings


Admin 10 Admin-Finance 96
Finance 10 Admin-Development 58
Development 46 Admin-Organizers 48
Organizers 25 Finance-Development 42
Finance-Organizers 35 (5)

6
Development-Financers 40

Finance
Organizers

Development
Admin

i) Suggest the most appropriate location of the server inside the above campus.
Justify your choice.
ii) Which hardware device can be used to connect all the computers within each
building?
iii) Draw the cable layout for economic and efficiently connect various buildings
within the campus?
iv) Whether repeater is required for your given cable layout? Yes or No? Justify
your answer.
v) A) Give your recommendation for live visual communication between all the
offices and customer located in different cities
a) Video Conferencing
b) Email
c) Telephony
d) Instant Messaging
OR
B) What type of network (PAN, LAN, MAN or WAN) will be setup
among the computers connected in this campus?

You might also like