Computer Science CASE 24 Set 2 QP
Computer Science CASE 24 Set 2 QP
General Instructions:
i. Please check this question paper contains 35 questions.
ii. The paper is divided into 4 Sections- A, B, C, D and E.
iii. Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.
iv. Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
v. Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
vi. Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
vii. Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
viii. All programming questions are to be answered using Python Language only.
SECTION – A
1. Which of the following is not a valid variable name in Python? 1
a. 5Radius b. Radius c. Radius5 d. _Radius
2. Identify the correct Python Library module for the function mean () from 1
the following options.
a. math b. random c. statistics d. string
3. Find the data type returned by the following expression. 1
X= 24//12+(5*3)/3
a. <class ' int '>
b. <class ' float ‘>
c. <class 'decimal’>
d. <class 'str’>
Page 1 of 13
5. What will be the output of the following code? 1
L= [ 'Case ', 'Exam ', '2024 ']
print (L [1][0])
a. E b. C c.2 d. m
6. Select the correct output from the following code: 1
T = ("Yellow", 20, "Red")
a, b, c = T
print(a)
a. Type error
b. Yellow
c. Yellow 20 Red
d. 20, Red
7. Given list L= [3,6,12,15,18], to insert the value 9 at the 2nd position which of 1
the following options is correct?
a. L.insert(2,9)
b. L.insert(1,9)
c. L.insert(9,2)
d. L.insert(9,1)
8. FTP stands for 1
a. Folder Transfer Protocol
b. File Transmission Protocol
c. Folder Transmission Protocol
d. File Transfer Protocol
9. Find the correct output for the following code: 1
for i in range (-7, -15, -2):
print(i+2)
a. -5 b. -5 c. -7 d. -5
-7 -7 -9 -7
-9 -9 -11 -9
-11 -13 -11
-13
Page 2 of 13
10. Rehan created a table CLIENT with 2 rows and 4 columns in MYSQL. He 1
added 2 more rows to it and deleted one column. What will be the
Cardinality and Degree of the Table CLIENT?
a. 2 ,4 b. 4,4 c. 4,3 d. 4,2
11. Out of the following, which switching technique does not require a 1
dedicated connection?
a. Circuit switching c. Packet switching
b. Message switching d. None of the above
a. 40$50$60$ c. 30$40$50$
b. 40$50$60$70$ d. 50$60$70
msg="CASE-Examination-2024"
print(msg.split("-"))
a. ('CASE', 'Examination', '2024')
b. ['CASE', 'Examination', '2024']
c. 'CASE', 'Examination', '2024'
d. ['CASE Examination 2024']
Page 3 of 13
15. Which of the following function header is correct? 1
a. def Func(x = 2, y = 3, z):
b. def Func(x = 2, y, z = 3):
c. def Func(x, y = 2, z = 3):
d. def Func(x, y, z = 3, p):
16. Choose the correct statement which will add the items of dictionary d2 to 1
d1.
d2={3:1 ,4:3,5:5}
a. d2.add(d1)
b. d1.merge(d2)
c. d2.update(d1)
d. d1.update(d2)
17. Assertion (A): The resultset refers to a logical set of records that are fetched 1
from the database by executing an SQL query.
18. Assertion (A): Exception handling in Python allows graceful recovery from 1
errors and prevents program crashes.
Reasoning (R): When an error occurs during program execution, the Python
exception handling mechanism allows the program to gracefully handle the
error and take corrective measures to be taken.
Page 4 of 13
SECTION – B
19. Observe the following Python code carefully and rewrite it after removing 2
all syntactical errors with each correction underlined.
Def execmain ():
x = int(input("Enter a number:"))
if (abs(x)=x):
print ("You entered a positive number")
Else:
x=*-1
print ("Number made positive:", x)
execmain()
20. a. Priya, a trainee programmer, created the table SUPPLIERS with a 1+1=2
column named PhoneNumber that uses a numeric data type.
However, when she tried to find customer details using a specific
phone number, her MySQL query did not give the desired result.
Help her in identifying the error and writing the correct query.
Page 5 of 13
OR
Write a user-defined function that takes integers in a tuple and calculates the
product, multiplying all items in a tuple.
For example:
N= (4,3,2,2, -1,18)
The output should be -864
22. a. Write the output for the following Python code. 1+1=2
S="WELcOME"
def Change (T):
global S
print(S)
S="Hello"
return S
Change(S)
print(S)
Also, identify the actual and formal parameters in the given code.
b. What is TELNET?
Page 6 of 13
24. Explain the difference between positional and keyword arguments with 2
suitable examples.
def mainfn():
Queen=Moves
Moves[2]+=22
L=len(Moves)
mainfn()
SECTION – C
26. Consider the table CUSTOMER given below and write the output for the 1*3=3
SQL Queries that follow.
Page 7 of 13
27. Predict the output of the Python code given below: 3
s="CBSE Exam-24"
n = len(s)
m=""
for i in range(0, n):
if (s[i] >= 'a' and s[i] <= 'm'):
m = m +s[i].upper()
elif (s[i] >= 'n' and s[i] <= 'z'):
m = m +s[i-1]
elif (s[i].isupper()):
m = m + s[i].lower()
else:
m = m +'&'
print(m)
-the countus() function should display the output as: "us occurs 2 times".
OR
I have a Computar.
I have a Computer.
Page 8 of 13
29. Consider the table FITNESS given below and answer the SQL queries that 1*3=3
follows.
For example:
The function POP() should delete the element and display as given below.
15
13
11
STACK UNDERFLOW.
Page 9 of 13
SECTION – D
31. Consider the tables STATIONERY and SUPPLIER and answer the 1*4=4
questions that follow:
Table: Stationery
Table : Supplier
Scode Sname
a. Identify the foreign key of the table Stationery and justify your choice.
b. Display the item number, Name of the item, Supplier code, and
supplier name of all the items in ascending order of supplier code.
Page 10 of 13
c. Display the Name of the item, Date of purchase, supplier code, and
supplier name of all the items that were purchased between 01-jan-2023
and 31-mar-2023(both inclusive)
d. Display the total amount earned by each supplier from the table
Stationery.
32. A CSV file “Product.csv” has structure [Pid, Pname, Qty, Price]. 4
a. Write a function CreateCSV() to add new records to the file
“Product.csv”.
b. Write a Python function called CountRec() that counts the number
of products with a quantity greater than 10 and returns the total
count.
SECTION -E
33. Trine Tech Corporation (TTC) is a professional consultancy company. The 1*5=5
company is planning to set up its new offices in India with its hub at
Hyderabad. As a network adviser, you have to understand their requirement
and suggest them the best available solutions.
Page 11 of 13
a. Suggest the most appropriate block to place the server.
b. Draw a block to cable layout to connect all the blocks in the most
appropriate manner for efficient communication.
c. What will be the best medium out of the following, to connect the
new setup offices in Bangalore with its London-based office:
i. Ethernet
iii. Satellite.
i. Switch
ii. Modem
iii. Gateway
34. a. State the difference between readline() and readlines() methods in 2+3=5
python.
OR
Page 12 of 13
35. a. Which clause will display the records without duplicates? Give an 1+4=5
example.
b. Sunil a grade 12 student has created a table INTERIORS and inserted the
following records in MYSQL Database FURNITURE.
Note the following to establish connectivity between Python and Mysql.
Username - root
Password - scott
Host- localhost
He wants to update the price of item no.6 (Item name - Jerry Look) to 8000
and discount to 15 in the table. Help Sunil to write the program in Python.
Page 13 of 13