Class 12 CS Preboard 2024 25
Class 12 CS Preboard 2024 25
24. Harsh has written a code to input a number and find a table of any number. His code is having errors. 2
Rewrite the correct code and underline the corrections made.
def table()
n=int(("Enter number which table U need: ")
for i in (1,11):
print("Table of Enter no=’,i*i)
Table()
25. Identify the correct output(s) of the following code. Also write the minimum and the maximum 2
possible values of the variable b.
import random
a="Wisdom"
b=random.randint(1,6)
for i in range(0,b,2):
print(a[i],end='#')
(a) W# (b) W#i# (c) W#s# (d) W#i#s#
26. Differentiate between count() and count(*) functions in SQL with appropriate example. 2
OR
Categorize the following commands as DDL or DML: INSERT, UPDATE, ALTER, DROP
27. (a) Write an SQL command to remove the Primary Key constraint from a table, named MOBILE. 2
M_ID is the primary key of the table.
(b) Write an SQL command to make the column M_ID the Primary Key of an already existing table,
named MOBILE.
28. (a) Write the full forms of the following: (i) VoIP (ii) TCP/IP 2
(b) How is http different from https?
SECTION – C (2 x 3 = 9)
29. Write a function ShowGrades(D) that takes dictionary D {‘Name’:[Phy,Chem, Math]} as 3
argument and print grades as per following rules:
if marks in all the subjects are 70 or above – A grade
if marks in any two subjects are 70 or above – B grade
if marks in any one subject is 70 or above – C grade
otherwise – E grade
30. Write a function count Dwords () in Python to count the words ending with a digit in a txt file 3
"Details. txt".
Example: If the file content is as follows:
On seat2 VIP1 wiil sit and On seatl VVIP 2 will be sitting
Output will be: Number of words ending with a digit are 4
31. A list contains following record of customer: [Customer_name, Room Type]. Write the following 3
user defined functions to perform, given operations on the stack named ‘Hotel’:
(i) Push_ Cust () - To Push customers' names of those customers who are staying in 'Delux' Room
Type.
(ii) Pop_ Cust () - To Pop the names of customers from the stack and display them. Also, display
''Underflow" when there are no ' customers in the stack.
OR
Write a function in Python, Push(Vehicle) where, Vehicle is a dictionary containing details of
vehicles - { Car Name: Maker}. The function should push the name of car manufactur by 'TATA'
(including all the possible cases like Tata, TaTa, etc.) to the stack.
For example:
If the dictionary contains the following data:
Vehicle={"Santro":"Hyundai","Nexon":"TATA","Safari":"Tata"}
The stack should contain:
Safari
Nexon
SECTION – D (4 x 4 = 16)
32. Write the outputs of the SQL queries (i) to (iv) based on the relations. COMPUTER and SALES 4
given below :
1) Suggest the most suitable place to install the server for the Delhi t branch with a suitable reason.
2) Suggest an ideal layout for connecting all these branches within Delhi.
3) Which device will you suggest that should be placed in each of these branches to efficiently
connect all the computer within these branches?
4) Delhi firm is planning to connect to its Marketing department in Kanpur which is approximately
300 km away. Which type of network out of LAN, WAN or MAN will be formed? Justify your
answer.
5) Suggest a protocol that shall be needed to provide help for tra~sferring of files between Delhi and
Kanpur branch.