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

Computer Science CASE 24 Set 2 QP

The document outlines the structure and content of the Common Rehearsal Examinations for Computer Science, scheduled for January 2024, with a total of 35 questions divided into five sections, each varying in mark distribution. It includes various types of questions, such as multiple-choice, programming tasks, and SQL queries, all intended to assess students' knowledge in Python and computer science concepts. Additionally, the exam emphasizes the use of Python for programming questions and includes instructions for answering.

Uploaded by

Memerboy
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)
24 views

Computer Science CASE 24 Set 2 QP

The document outlines the structure and content of the Common Rehearsal Examinations for Computer Science, scheduled for January 2024, with a total of 35 questions divided into five sections, each varying in mark distribution. It includes various types of questions, such as multiple-choice, programming tasks, and SQL queries, all intended to assess students' knowledge in Python and computer science concepts. Additionally, the exam emphasizes the use of Python for programming questions and includes instructions for answering.

Uploaded by

Memerboy
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

CENTRE FOR ADVANCEMENTS OF STANDARDS IN EXAMINATIONS

(GEMS ASIAN SCHOOLS)


COMMON REHEARSAL EXAMINATIONS – JANUARY 2024
(ALL INDIA SENIOR SCHOOL CERTIFICATE EXAMINATION)

COMPUTER SCIENCE (Code: 083)


Maximum Marks: 70 Time: 3 Hrs.

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’>

4. Choose the correct DDL command from the options given. 1


a. Insert b. Add c. Alter d. Delete

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

12. What happens if no arguments are passed in the seek() method? 1


a. The file pointer is set to the start of the file
b. The file pointer is set to the end of the file
c. The file pointer remains unchanged
d. It results in an error

13. Choose the correct output for the following code: 1


import random
num=[20,30,40,50,60,70]
start=random.randint(1,3)
stop=random.randrange(2,4)
for i in range(start,stop+1):
print (num[i],end="$")

a. 40$50$60$ c. 30$40$50$

b. 40$50$60$70$ d. 50$60$70

14. What will be the output of the following string operation? 1

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.

d1={1:1 ,2:4 ,2:8}

d2={3:1 ,4:3,5:5}

a. d2.add(d1)
b. d1.merge(d2)
c. d2.update(d1)
d. d1.update(d2)

Q17 and 18 are ASSERTION and REASONING-based questions. Mark the


correct option as

a. Both A and R are true and R is the correct explanation of A


b. Both A and R are true and R is not the correct explanation of A
c. A is True but R is False
d. A is False but R is True

17. Assertion (A): The resultset refers to a logical set of records that are fetched 1
from the database by executing an SQL query.

Reasoning (R ): Resultset stored in a cursor object can be extracted by using


fetch(..) functions.

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.

"SELECT * FROM SUPPLIERS WHERE PhoneNumber = '345941'"

b. In addition, Priya ran a query on the table customer and received a


record count of 9 instead of the expected 10. The query she used was
"SELECT COUNT(SALARY) FROM SUPPLIERS."
What could be the reason for this discrepancy?

21. Write a user-defined function CHANGESTR(STRING) that takes a string as 2


input and adds 'ing' at the end of a given string (length should not be less
than 3). If the given string ends with 'ing', add 'ly' instead. If the string length
of the given string is less than 3, leave it unchanged.
For example:
If the string is "caring" it should display "carly".
If the string is "at" it should display "at".

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. Find the output for the following Python code.


def dictfn(Bitem):
lst=[]
for k, v in Bitem.items():
if v<50:
lst.append(k)
print(lst)
Bitem={'Bread':25,'Biscuit':35,'Chocolates':50}
dictfn(Bitem)

23. a. Expand the term: 1+1=2


i. PPP
ii. ARPANET

b. What is TELNET?

Page 6 of 13
24. Explain the difference between positional and keyword arguments with 2
suitable examples.

25. Write the output of the following Python code: 2

def mainfn():

Moves=[11, 22, 33, 44]

Queen=Moves

Moves[2]+=22

L=len(Moves)

for i in range (L):

print(Queen[L-i-1], "#", Moves [i])

mainfn()

SECTION – C
26. Consider the table CUSTOMER given below and write the output for the 1*3=3
SQL Queries that follow.

a. SELECT NAME, PRICE, QTY FROM CUSTOMER WHERE CID IN


(111,333,666);
b. SELECT NAME, QTY, PRICE FROM CUSTOMER WHERE NAME
LIKE "%A_";
c. SELECT CID, SUM(PRICE) FROM CUSTOMER GROUP BY CID
HAVING SUM(PRICE) > 50000;

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)

28. Write a function countus() in Python to read a text file "ABOUTUS.TXT" 3


and count the number of times "us" occurs in the file.

For example, if the file ABOUTUS.TXT contains:

"Python Language helps us to develop game programs.

It also helps us to develop simple programs"

-the countus() function should display the output as: "us occurs 2 times".

OR

Write a Python function, ATOEDISP(), that reads a text file, NEWS.TXT


replaces all instances of “a” with “e”, and displays the updated content of
the file. For instance, if NEWS.TXT contains

I have a Computar.

The function should display

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.

PCODE PNAME PRICE MANUFACTURER

P1 Treadmill 21000 Coscore

P2 Bike 20000 Aone

P3 Cross Trainer 14000 Reliable

P4 Multi Gym 34000 Coscore

P5 Massage Chair 5500 Regrosene

a. Display the average price for the manufacturer Coscore.

b. Add the following record to the table Fitness.

P6 , Barbell , 4500 , Reliable

c. Delete the column manufacturer from the table Fitness.

30. Write a function in Python PUSH(INTLIST), where INTLIST is a list of 3


integers. From this list push all odd numbers into a stack implemented by
using a list. Also write a function POP() to delete the elements in the stack if
it has at least one element, otherwise display STACK UNDERFLOW. Also,
display the deleted element.

For example:

If the content of the INTLIST is [10,11,12,13,14,15], it should push [11,13,15]


into the stack.

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

Item_no Iname Scode Qty Unit Purchase_date


price
101 Gumtube 702 100 15 30-Mar-2023

102 Double stick 702 150 20 01-Jan-2023


tape
103 Pencil 701 125 5 14-Feb-2023

104 Crayons 702 210 6 01-Jan-2023

105 Notebook 701 100 15 14-Feb-2023

106 Sharpener 705 200 10 04-Apr-2023

Table : Supplier
Scode Sname

701 Gupta Stationery shop

702 Sharma Stationery

703 Avon Shop

704 Raza Stationers

705 Faber castle stationary

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.

Their queries are mentioned as (i) to (iv) below.


Physical Locations of the blocked of TTC

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

ii. Fiber optic cable

iii. Satellite.

d. Which of the following devices will be suggested to connect each


computer in each of the blocks?

i. Switch

ii. Modem

iii. Gateway

e. Suggest a system (hardware/software) to prevent unauthorized


access to or from the network.

34. a. State the difference between readline() and readlines() methods in 2+3=5
python.

b. Consider a binary file "employee.dat" containing details such as empno,


empname, and salary. Write a Python function PRINTDATA () to display
the details of those employees who are earning between 20000 and
30000(both values inclusive).

OR

(Option for part (b) only)

b.Write a function ROUTECHANGE(route_no) which takes the route


number as a parameter and modifies the route name (Accept it from the
user) of the given route number in a binary file "route.dat" which has route
details such as [routeno,routename].

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

You might also like