0% found this document useful (0 votes)
269 views8 pages

CSSC 23-24 QP Paper2

Uploaded by

SR
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)
269 views8 pages

CSSC 23-24 QP Paper2

Uploaded by

SR
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/ 8

CHENNAI SAHODAYA SCHOOLS COMPLEX

COMMON EXAM PRACTICE PAPER-2: 2024


(Computer Science - 083)
Roll No.: Maximum Marks: 70
Date: DD/MM/YYYY Time allowed: 3 hours

(General Instructions)
 Please check that this question paper contains ___8___ printed pages.
 Please check that this question paper contains 35 questions.
 Please write down the serial number of the question before attempting it.
 Reading time of 15 minutes is given to read the question paper alone. No writing
during this time.
 The paper is divided into 5 Sections- A, B, C, D and E.
 Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.
 Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
 Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
 Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
 Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
 All programming questions are to be answered using Python Language only.
Q.No. Question Marks
SECTION – A
1. State True or False : (1)
“All elements in Python list must be of same data type”
2. In MYSQL database, if a table, SCHOOL has degree 4 and cardinality 5, and (1)
another table, STUDENT has degree 4 and cardinality 3, what will be the degree
and cardinality of the Cartesian product of SCHOOL and STUDENT?

(a) 4,5 (b) 4, 3 (c) 8,15 (d) 16,8

3. Which of the following is an invalid identifier? (1)

(a)_123 (b) E_e12 (c) none (d) True


4. Identify the correct output of the following code : (1)
X= “Aim for high score”
a=X.split()
print('$'.join([a[0],a[2].capitalize(),a[3]]))

(a) Aim$for$high$score
(b) AIM$FOR$score
(c) Aim$High$score
(d) Aim$FOR$score
5. Which is not a constraint in SQL ? (1)

(a) Unique (b) Distinct (c) Primary key (d) Check

6. Expand : POP3 (1)

7. Identify the correct output of the following code : (1)


a=[10,2,5,7674,7,8]
a.extend([1,2])
a.append([100,200])
print(a[a[a[2]]])
(a) 100 (b) 2 (c) [100,200] (d) Error

1
CHENNAI SAHODAYA SCHOOLS COMPLEX

8. Which of the following statement is correct syntactically? (1)


(a) print('hello',end='%',sep='#')
(b) print('hello',sep='#',end=’%’)
(c) Both (a) and (b)
(d) Neither (a) not (b)
9. What will be the output of the following code : (1)
print(eval('150+300'))
(a) 450 (b) 150+300 (c) 150300 (d) 300

10. Choose the correct output of the following code : (1)


T=tuple({1:’one’,20:’twenty’})
print(T)
(a) (1,20) (b) (‘one’,’twenty’)
(b) (c) ((1.’one’),(20,’twenty’)) (d) error
11. Which type of transmission media is the least expensive to manufacture? (1)
a) Twisted pair cable
b) CAT cable
c) Coaxial
d) Fiber optic
12. Choose the correct option to get the output 8 (1)
a=”welcome to wonder world”
s1=a._____________(‘o’)
s2=a._____________(‘w’)
print(len(s1)+len(s2))
(a) partition, split (b) split, partition
(c) partition, partition (d) split, split
13. Select the correct output of the code: (1)
s = “Question paper2022-23”
s= s.split(‘2’)
print(s)
(a) [‘Question paper’, ‘0’, ‘’, ‘-’, ‘3’]
(b) (‘Question paper’, ‘0’, ‘’, ‘-’, ‘3’)
(c) [‘Question paper’, ‘0’, ‘2’, ‘’, ‘-’, ‘3’]
(d) (‘Question paper’, ‘0’, ‘2’, ‘’, ‘-’, ‘3’)
14. Choose the correct command to delete an attribute gender from a relation student. (1)
(a) ALTER TABLE student DELETE gender
(b) ALTER TABLE student DROP gender
(c) ALTER TABLE DROP gender FROM student
(d) DELETE gender FROM student
15. Fill in the blank: (1)
________ is the protocol used for transferring files from one machine to another.
a) HTTP
b) FTP
c) SMTP
d) VOIP
16. Choose the correct output of the following code : (1)
a={1:’one’, 2:’Fine’,’one’:3,3:4,4:”Good”}
print(a[a[a[‘one’]]])
(a) 3 (b) one (c) Good (d) Error
Q17 and 18 are ASSERTION AND REASONING 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
17. Assertion (A): To store the data permanently into the file we use file handling. (1)
Reason (R): A file is a named location on a disk to store related information.

2
CHENNAI SAHODAYA SCHOOLS COMPLEX

Assertion(A): Keyword argument were the named arguments with assigned


18. values being passed in the function call. (1)
Reasoning (R): Default arguments cannot be skipped while calling the function
while keyword arguments are in function call statement.
SECTION – B
19. Write any 2 differences between a HUB and a SWITCH ? (2)
20. If a is (1, 2, 3) then what is the difference between a * 3 and (a, a, a) ? (2)
21. Predict the output of the following code : (2)
D={'month':'DECEMBER','exam':'PREBOARD1'}
D['month']='JANUARY'
D['EXAM']='PRE2'
print(D)
D1={'school':'JUNE','month':'AUGUST'}
D.update(D1)
print(D)
22. Mr. Krishna wants to print the city he wants to visit and the distance to reach (2)
that place from his native. But his coding is not showing the correct output. Debug
the code to get the correct output and state what type of argument he tried to
implement in his coding.
def Travel (c,d)
print(“Destination city is “,distance)
print(“Distance from native is “,city)
Travel(distance=”18 KM”,city=”Tiruchi”)
23. Predict the output of the following code : (2)
def Change_text(Text):
T=""
for K in range(len(Text)):
if Text[K].isupper():
T=T+Text[K].lower();
elif K%2==0:
T=T+Text[K].upper()
else:
T=T+T[K-1]
print(T)
Text="Good To All"
Change_text(Text)
24. Answer the questions based on the following table : (2)

BNO TITLE AUTHOR TYPE PUB QTY PRICE


1 Data Structure Lipschutz DS McGraw 4 217
2 Computer Studies French FND Galgotia 2 75
3 Advanced Pascal Schildt PROG McGraw 4 350
4 Dbase dummies Palmer DBMS Pustak 5 130
5 Mastering C++ Gurewich PROG BPB 3 295
6 Guide Network Freed NET Zpress 3 200
7 Mastering Foxpro Seigal DBMS BPB 2 135
8 DOS Guide Norton OS PHI 3 175
9 Basic for Beginners Norton PROG BPB 3 40
10 Mastering Windows Cowart OS BPB 1 225

(a) What is the degree and cardinality of the above table?

(b) When 2 rows are added and 3 attributes are deleted from the table what is the
cardinality of the new table.

3
CHENNAI SAHODAYA SCHOOLS COMPLEX

(OR)
Ms.Sita has just created a table named “sweets” containing columns Sname,
Quantity and Price.
After creating the table, she realized that she has forgotten to add a primary key
column in the table. Help her in writing an SQL command to add a primary key
column SID of integer type to the table sweets. Thereafter, write the command to
insert the following record in the table:
SID- 999
Sname- Kaju Katli
Quantity : 40
Price : 2

25. What possible outputs are expected to be displayed on screen at the time of (2)
execution of the program from the following code? Also specify the maximum
value that can be assigned to each of the variables L and U.

import random
Arr=[10,30,40,50,70,90,100]
L=random.randrange(1,3)
U=random.randrange(3,6)
for i in range(L,U+1):
print(Arr[i],"@",end="")

(i) 40 @50 @ (ii) 10 @50 @70 @90 @


(iii) 40 @50 @70 @90 @ (iv) 40 @100 @

(OR)
What are the incorrect output(s) from the given options when the following
code is executed? Also specify the minimum and maximum values that can
be assigned to the variable VALUE.

import random
VALUE = random.randint (0,3)
SUBJECT=[“PHY”,”CHEM”,”MATHS”,”COMP”];
for I in SUBJECT:
for J in range(1, VALUE):
print(I, end=””)
print()

i) PHYPHY
CHEMCHEM
MATHSMATHS
COMPCOMP

ii) PHY
PHYCHEM
PHYCHEMMATHS

iii) PHY
CHEMCHEM
COMPCOMPCOMP

iv) PHY
CHEM
MATHS
COMP

4
CHENNAI SAHODAYA SCHOOLS COMPLEX

SECTION – C
26. Predict the output of the following code: (3)
def div5(n):
if n%5==0:
return n*5
else:
return n+5
def output(m=4):
for i in range(0,m):
print(div5(i),'@',end=' ')
print( )
output(5)
output()
output(3)
(1*3=3)

27. Write output of the queries (i) to (iii) based on the table Sportsclub
Tble Name: Sportsclub
Playerid pname Sports Country Rating Salary
10001 PELE SOCCER BRAXIL A 50000
10002 FEDERER TENNIS SWEDEN A 20000
10003 VIRAT CRICKET INDIA A 15000
10004 SANIA TENNIS INDIA B 5000
10005 NEERAJ ATHLETICS INDIA A 12000
10006 BOLT ATHLERIC JAMAICA A 8000
10007 PAUL SNOOKER USA B 10000

(i) SELECT DISTINCT sports FROM Sportsclub;


(ii) SELECT sports, MAX(salary) FROM Sportsclub GROUP BY sports
HAVING sports<>'SNOOKER';
(iii) SELECT pname, sports, salary FROM Sportsclub WHERE country='INDIA'
ORDER BY salary DESC;

28. Write a function COUNTWORD( ), which counts all the words from the text file? (2*1 ½
=3)
Book.txt whose second last character is ‘r’
For example, if the Book.txt file contains
India is my country. They are studying.
then the output should be: 2
(OR)
Write a function countEU() in Python, which should reads each character of a text file.
IMP.TXT, should count and display the occurrence of alphabets E and U (including small
cases e and u too).
e. g. if the file content is as follows:
Pinaky has gone to his friend's house. His friend's name is Ravya. Her house is 12 km from
Pinaky's house.

The countEU() function should display the output as


E:8
U:3

5
CHENNAI SAHODAYA SCHOOLS COMPLEX

29. Consider the table FASHION given below, write SQL queries : (1*3=3)
Table: FASHION
ID PRODUCT PRICE QTY
F01 Kajal 970 10
F02 Foundation 2100 15
F03 Night Cream 1700 20
F04 Day Cream 1400 10
F05 Shampoo 1200 25
F06 Lipstick 850 32

a) Increase the price of Kajal by 5%


b) Display product and price of all products whose qty is more than 20 and
product name contains the character ‘s’.
c) Delete the details of all product whose price is more than 1200.
Write a function in Python, Push(BItem) where BItem is a dictionary containing the
details of bakery items– {Bname:price}. The function should push the names of those
30. items in the stack S who have price less than 50. (3)
For example: If the dictionary contains the following data:
Bitem={"Bread":40,"Cake":250,"Muffins":80,"Biscuits":25}
The stack should contain
Bread
Biscuits

SECTION – D
31. Consider the tables LAB and TRADER given below : (1*4=4)
Write SQL queries for the questions (i) to (iv)
LAB
LabNo ItemName CostPerItem Quantity Dateofpurchase Warranty
1 Computer 60000 9 21/05/1996 1
2 Printer 15000 3 21/05/1997 4
3 Scanner 18000 1 29/08/1998 1
4 Camera 21000 2 13/10/1996 1
5 Switch 8000 1 31/10/1999 2
6 UPS 5000 5 21/05/2000 1
7 Router 25000 2 11/01/2000 2
8 Repeater 12000 4 10/02/1998 2

TRADER
LNO TraderName City
3 Busy Store Corp Mumbai
1 Electronic show Chennai
5 Busy Store Corp Bangalore
8 Sale Corp Chennai
2 Electronic show Delhi
(i) To display all the itemName whose name starts with “C” in Chennai city.

(ii) To list the ItemName in ascending order of the date of purchase where
quantity is more than 3.

(iii) To update the ItemName to “Web Cam” where Itemname ends with ‘a’.

(iv) To display the Itemname, Quantity and TraderName of an item purchased


after 01/01/1998.

6
CHENNAI SAHODAYA SCHOOLS COMPLEX

32. Write a program in Python that defines the following user-defined functions: (4)
AddRecord() – To accept and add data of Mobile phones to a CSV file
‘Mobile.csv’. Each record consists of a list with field elements as
ModelNo, MobileName, Manufacturer and Price to store model number,
mobile name, manufacturer and price respectively.
Find() – To search the records of mobiles manufactured by Apple present in the
CSV file named ‘Mobile.csv’.

SECTION – E
33.

Sony has set up its Branch at Srinagar for its office and web-based activities. It (1*5=5)
has four zones of buildings as shown in the diagram:

ZONE ZONE
Z Y

ZONE
ZONE
X
U

Branch-to-branch distance is:


Zone X to Zone Z 40 m
Zone Z to Zone Y 60 m
Zone Y to Zone X 135 m
Zone Y to Zone U 70 m
Zone Z to Zone U 165 m
Zone Z to Zone U 80 m

Number of Computers :
Zone X 50
Zone Z 130
Zone Y 40
Zone U 15

(a) Suggest the most suitable cable layout or Networking Topology of connections
between the zones.
(b) Suggest the most suitable place (i.e., Zone) to house the Server of this
organization. Give a suitable reason with justification.
(c) Suggest the placement of the following devices with justification:
(i) Repeater (ii) Hub/Switch
(d) Which is the most economic type of cable for the selected topology?
(e) Suggest a device/software to be installed in each branch to take care of data
security.

7
CHENNAI SAHODAYA SCHOOLS COMPLEX

34. Write a Program in Python that defines the following user defined functions:

(i) ADD() – To accept and add data of an item to a binary file ‘events.dat’. Each
record of the file is a list
(5)
[Event_id, Description, Venue, Guests, Cost].
Event_Id, Description, and venue are of str type, Guests and Cost are of
int type.

(ii) COUNTR() – To read the data from the file ‘events.dat’, calculate and display
the average cost.

Preety has created a table named EMP with the following details.

Empcode – integer
35. EmpName – string (5)
EmpSalary – float

Note the following to establish connectivity between Python and MYSQL:

• Username is root
• Password is root@123

• The table exists in a MYSQL database named management.


Preety wants to display only those records who have salary greater than 53500.

END OF PAPER

You might also like