CS Model I AK
CS Model I AK
SECTION A
1 mark for each correct answer
1. True
2. (B) TheQUICK_BROWN_FOX
4. (A) Pytho+isfu+
5. (D) ginyn
7. (B) print(fruit_prices['mangeo'])
8. (D) Removes the element at index x from the list and returns it.
9. (C) 4
11. False
13. Delete
15. (C) The maximum length of a VARCHAR column is always less than that of a
CHAR column.
20. (A)Both A and R are true and R is the correct explanation for A
21. (B)Both A and R are true and R is not the correct explanation for A
Page 1
22. (A):
(B):
b = [1, 2, 3, 4]
d = (5, 6, 7, 8)
½ mark for each correct explanation & ½ mark for each correct output
23. (I) Assignment Operators: Used to assign values (=, +=, -=).
(II) Identity Operators: Used to check if two objects are the same (is, is not).
(I)(B): min(L1)
Page 2
(II)(A) ALTER TABLE Users MODIFY email VARCHAR(25);
OR
(B) ALTER TABLE Customers ADD PRIMARY KEY (Customer_ID);
(1 mark for correct answer)
28. (A): MODEM stands for Modulator-Demodulator, used for converting digital data
to analog signals and vice versa in networking.
(1 mark for correct expansion)
(1 mark for correct usage)
(B): In mesh topology, the advantage is high reliability and fault tolerance, while
the disadvantage is high cost and complexity due to numerous connections.
(1 mark for correct Advantage)
(1 mark for correct Disadvantage)
SECTION C
29. (A)
def extract_lines_with_to_do():
try:
with open("Vocab.txt", "r") as file:
for line in file.readlines():
if "TO" in line.upper() or "DO" in line.upper():
print(line.)
except FileNotFoundError:
print("The file 'Vocab.txt' was not found.")
Page 3
½mark for correct loop
½mark for correct use of split( )
1 mark for correct condition
½ mark for output display
30. (A) MovieStack Implementation
MovieStack.append(new_movie)
(II)
def pop_movie(MovieStack):
if MovieStack:
return MovieStack.pop() # Removes and returns the topmost movie
else:
print( "Stack is empty")
(III)
def peek_movie(MovieStack):
if MovieStack:
return MovieStack[-1] # Returns the topmost movie without removing it
else:
print( "None")
(3x1 mark for correct function body; No marks for any function header as it
(B)
(I) OddNumbers = []
def push_odd(M):
for num in M:
if num % 2 != 0:
OddNumbers.append(num)
(II)
def pop_odd():
if OddNumbers:
return OddNumbers.pop()
else:
print( "Stack is empty")
(III)
def disp_odd(OddNumbers):
Page 4
if OddNumbers:
print( OddNumbers )
else:
print("None")
(3x1 mark for correct function body; No marks for any function header as it
31. cO*P*t*R
OR
32. (A)
OR
(B)
(I)
C_Name | Total_Quantity
--------- |---------------
Jitendra | 1
Mustafa | 2
Dhwani | 1
Alice |1
David | NULL
(II)
O_Id | C_Name | Product | Quantity | Price
----- |-------- |------------ |---------- |-------
1002 | Mustafa | Smartphone | 2 | 10000
1003 | Dhwani | Headphone | 1 | 1500
1004 | Alice | Smartphone |1 | 9000
Page 5
(III) O_Id | C_Name | Product | Quantity | Price
----- |---------- |------------ |---------- |-------
1001 | Jitendra | Laptop | 1 | 12000
1002 | Mustafa | Smartphone | 2 | 10000
(IV)
MAX(Price)
-----------
12000
(4 x 1 mark for each correct output)
33. (I) import csv
def filter_life_expectancy_above_75(filename):
with open(filename, mode='r') as file:
reader = csv.reader(file)
next(reader, None)
result = []
for row in reader:
if float(row[1]) > 75:
print(row)
(½ mark for opening in the file in right mode)
(II)
def count_records(filename):
with open(filename, mode='r') as file:
reader = csv.reader(file)
next(reader, None)
count=0
for i in reader:
count+=1
print(count)
Page 6
34. ( I ) SELECT * FROM STUDENTS S JOIN SUBJECTS Sub ON S.S_ID = Sub.S_ID
OR
def AddAndDisplay():
Page 7
(½ mark for correctly executing the second query)
(½ mark for correctly displaying the data)
SECTION E
def NewTest():
try:
with open("TEST.dat", "ab") as file:
TestId = int(input("Enter Test ID: "))
Subject = input("Enter Subject: ")
MaxMarks = int(input("Enter Maximum Marks: "))
ScoredMarks = int(input("Enter Scored Marks: "))
test_record = [TestId, Subject, MaxMarks, ScoredMarks]
pickle.dump(test_record, file)
print("Record added successfully!")
except Exception as e:
print("Error:", e)
(½ mark for input + 1 mark for correct use of dump( ) to add new test)
Page 8
if updated:
print(f"MaxMarks updated by 10 for subject: {Sub}")
else:
print(f"No records found for subject: {Sub}")
except Exception as e:
print("Error:", e)
(1 mark for correct use of load( ) method to retrieve data + ½ mark for correct loop +
½ mark for correct condition within loop )
print("Error:", e)
( 1 mark for correct use of load() and checking and ½ mark for correct display of
data loop )
Page 9
(II) A switch should be used within each building to connect all computers.
( 1 Mark)
Cable Recommendation: Fiber optic cable is recommended for high speed data
transfer and reliable communication over distances. ( ½ + ½ mark)
(III) There is no need for a repeater in this layout. The maximum distance
between any two buildings is 90 meters, which is well within the 100-meter limit
for Ethernet cable or fiber optics before requiring a repeater. ( 1 mark )
OR
(V) B) The network type in the Chennai hub would be a LAN (Local Area
Network) (1 mark)
*************************
Page
10