0% found this document useful (0 votes)
135 views14 pages

Class 12 CS Supplementary Exam 2024 QP

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)
135 views14 pages

Class 12 CS Supplementary Exam 2024 QP

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/ 14

Set-4

Series &RQPS/S
Q.P. Code 91/S

Candidates must write the Q.P. Code


RollNo. on the title page of the answer-book.

COMPUTER SCIENCE

Time allowed : 3 hours Maximum Marks : 70

NOTE

(1) Please check that this question paper contains 15 printed pages.
(1) Please check that this question paper contains 35 questions.
(1) Q.P. Code given on the right hand side of the question paper should be written on
the title page of the answer-book by the candidate.

(IV) Please write down the serial number of the question in the answer-book
before attempting it.

(V) 15 minute time has been allotted to read this question paper. The question paper
will be distributed at 10.15 a.m. From 10.15 a.m. to 10.30 a.m., the students will
read the question paper only and will not write any answer on the answer-book
during this period.

91/S 1 P.T.O.
General Instructions :
Please read the instructions carefully.
This question paper has 5 Sections : Sections A, B, C, D, E.
Allquestions are compulsory. However, an internal choice of approximately
30% is provided.
Section A has 18 questions carrying l mark each.
Section B has 7 Very Short Answer (VSA) type questions carrying 2 marks
each.
Section C has 5 Short Answer (SA) type questions carrying 3 marks each.
Section D has 2 Long Answer (LA) type question carrying 4 marks.
Section E has 3 Source-based/Case-based IPassage-based questions carrying
5 marks each.

SECTION A 18x1=18

1. State True or False:


"In Python, tuple is a mutable data type". F
2. The primary key is selected from the set of 1

(A) composite keys (B) alternate keys


(C) candidate keys (D) foreign keys

3. What will be the output of the following statement ?


print (6+5/4 **2//5+8)

(A) -14.0 (B) 14.0

(C) 14 (D) -14


1
4. Select the correct output of the code:
S"text#next"
print (S. strip("t"))
(A) ext#nex (B) ex#nex
(C) text#nex (D) ext#next

91/S 2
5. In SQL, which command will be used to add a new record in atable? 1

(A) UPDATE

(B) ADD

(C) INSERT

(D) ALTER TABLE

6. Lin HTML stands for: 1

(A) Large B) Language


(C) Long (D) Laser

7. Identify the valid Python identifier from the following: 1

(A) 2user (B) user@2


-(C) user2 (D) user 2

8. Consider the statements given below and then choose the correct output
from the given options : 1
Game="World Cup 2023"
print (Game[-6::-1])
(A) CdrW (B) ce o
(C) puC dlroW (D) Error

9. Predict the output of the following Python statements: 1


>>>import statistics as s
>8.mode ([10, 20, 10, 30, 10, 20, 301)
(A) 30
(B) 20
(C) 10
(D) 18.57

91/S 3 P.T.O.
14. Mr. Ravi is ereating a field that contains alphanumeric values and fixed
1
lengths. Which MySQL data type should he choose for the same ?
(A) VARCHAR
B) CHAR
(C) LONG
(D) NUMBER

1
15. Fillin the blank :
The full form of WwW is

16. files are stored in a computer in a sequence of bytes.


(A) Text
(B) Binary
(C) CSV
(D) Notepad

Questions No. 17 and 18are Assertion and Reason type questions. Each question
consists of tuo statements, namely, Assertion (A) and Reason (R). Select the most
suitable option considering the Assertion and Reason.
17. Assertion (A):Global variables are accessible in the whole program.
Reason (R): Local variables are accessible only within a function or block
in which it is declared.
(A) Both Assertion (A) and Reason (R) are true and Reason (R) is the
3 correct explanation of Assertion (A).
B} Both AsHertion (A) and Reason (R) are true, but ReaSOn (R)is not the
correct explanation of Assertion(A).
C) Assertion (A)is true, but Reason (R)is false.
D} ARErtion(A)is fale, but Reason (R)is true.
5 P.rO.
91/9
15. Assertion LA) if numeric data are to be written to a text file, the data
needs to be converted into a string before writing to the tile.
Reason (R: write) method takes a string as an argument and writes it
to the text file.
LA) Both Assertion (A) and Reason (R) are true and Renson (R) is the
correct explanntion of Assertion (A).
5) Both Assertion (A) and Reason (R) are true, but Reason (R) is not the
correct explanation of Assertion (A).
(C) Asertion A) is true, but Reason R) is false.
D) Asertion (A) is false, but Reason (R) is true.

SECTION B 72u14
19. (a Expand the following terms: 14l=2
URL, XML
Give one difference between HTTP and FTP.
OR

Define the term IP address with respeet to network.


fi) What is the main purpose of aRouter ?

Oterve the foliowing code carefully snd rewrite it after removing


all syatactical errors Underline all the correctiona made
det 1fune ()
asnput("Entera nunber"))

prknt("Promoted ta nat elass)

peint(Repest)
21. (a) Write the definition of a method/funetion Searchout (Teachers,
TName) to search for TName from a list Teachers, and display the
position of its presence.
For example :
If the Teachers contain "Ankit", *Siddharth" "Rahul"
"Sangeeta", "rahul")
and TName contains "Rahul"
The function should display
Rahul at 2
rahul at 4

OR

(b) Write the definition of a method/function Copy_Prime (lst) to copy


al the prime numbers from the list lst to another list lst_ prime.

2
22. Predict the output of the following code:
d={"IND": "DEL", "SRI: "COL", "CHI": "BEI"}
str+=

for i in d:
strl=strl+st (d[i])t""
str2=strl[:-1l
print (str2)

23. (a) Write the Python statement for each of the folowing tasks using
BUILT-IN functions/methods only : 1+1-2

(i) To delete an element 10 from the list lst.


(ü) To replace the string "Thig" with "That" in the string strl.
OR
(b) A dictionary dict2 is copied into the dictionary dictl such that the
common key's value gets updated. Write the Python commands to do
the task and after that empty the dictionary dictl.
7 P.TO.
91/S
24. (a) Mr. Atharva is given a task to create a database,
Admin. He has to
create a table, users in the database with the following columns : 1+1=2
User id - int
User name varchar (20)
PasswOrd - varchar (10)
Help him by writing SQL queries for both taskS.

OR

(b) Ms. Rita is a database administrator at a school. She is


the table, student containing the columns like working on
Stud id, Name,
Class and Stream. She has been asked by the Principal to strike off
the record of a student named Rahul with
student id as 100 from
the school records and add another student who has
been admitted
with the following details:
1+1-2
Stud id - 123
Name - Rajeev
Class 12
Stream - Science
Help her by writing SQL queries for both tasks.

25. Predict the output of the following code:


def Total (Num=10) :
Sum=0

for C in range (1, Num+1) :


i£ c%2!=0:
continue
Sum+=C
return Sum

print (Total (4) ,end="$")


print (Total () sep="@")

91/S
SECTION C 5x3=15

26. Predict the output of the Python code given below : 3

s="India Growing"
n = len (s)

for i in range (0, n) :


if (s[il >= 'a' and s[i] <= 'm') :
m = m + s [i].upper ()
elif (s [i] >= '0' and s[i] <= 'z'):
m = m +s [i-1]
elif (s[i].isupper (0):
m = m + sil.lower ()
else:
m = m+ @
print (m)

27. Consider the table Stationery given below and write the output of the
SQL queries that follow. 3

Table : Stationery
ITEMNOITEM DISTRIBUTOR QTY PRICE
401 Ball Pen 0.5 Reliable Stationers 100 16
402 Gel Pen Premium Classic Plastics 150 20
403 Eraser Big Clear Deals 210 10
404 Eraser Small Clear Deals 200
405 Sharpener Classic Classic Plastics 150
406 Gel Pen Classic Classic Plastics 100 15

(i) SELECT DISTRIBUTOR, SUM(QTY) FROM STATIONERY GROUP


BY DISTRIBUTOR;
(ii)) SELECT ITEMNO, ITEM FROM STATIONERY WHERE
DISTRIBUTOR= "ClassicPlastics" AND PRICE > 10;
(ii) SELCET ITEM, QTY* PRICE AS "AMOUNT" FROM STATIONERY
WHERE ITEMNO=402;
91/S P.T.O.
28. (a) Write a methodifunction COUNTWORDs () in Pythen to read contents
from a text file DECODE. TXT, te count and return the occurrence of
those words, which are having 5 or more characters.
OR

(b) Write a method/function COUNTLINES () in Python to read lines from


a text file cONTENT. TXT, and display those lines, which have
@anywhere in the line. 3

For exampBe :
If the content of the file is:
Had an amazing tine at the concert last night with
@MusicLoversCrew.
Excited to announce the launch of our new website!

G20 @ India

The method'function should display


Had an amazing time at the concert last níght with
MusicLoversCrew
G20@ India

29. Consider the table Rent_cab, given below :


Table: Rent_cab
Vcode VName Make Color Charges
101 Big car Carus White 15
102 Small car Polestar Silver 10
103 Family car Windspeed Black 20
104 Classic Studio White 30
105 Luxury Trona Red

Based on the given table, write SQL queries for the


following: 3
(i) Add a primary key to a column name Vcode.
(ii) Increase the charges of all the cabs by
10%.
(iii) Delete all the cabs whose
maker name is "Carus".
91/5
10
30. Adictionary, d citycontains the records in the following format:
{state:city}
Define the following functions with the given specifications : 3

(i) push city(d city): It takes the dictionary as an argument and


pushes all the cities in the stack CITY Whose states are of more than
4 characters.

(ii) pop city (): This function pops the cities and displays "Stack
ermp ty'" when there are no more cities in the stack.

SECTION D 2x4=8

31. Consider the tables GAMES and PLAYERSgiven below :


Table: GAMES
GCode GameName Type Number PrizeMoney
101 Carrom Board Indoor 2 5000
102 Badminton Outdoor 2 12000
103 Table Tennis Indoor 4 NULL
104 Chess Indoor 2 9000
105 Lawn Tennis Outdoor4 25000

Table: PLAYERS
PCode Name GCode
Nabi Ahmad 101
2 Ravi Sahai 108
Jatin 101
4 Nazneen 103

Write SQL queries for the following :


number of games played in each
(1) DiSplay the game type and average
type.
the players from
(ii) Display prize money, name of the game, and name of
the tables Games and Players.
(ii) Display the types of games without repetition.
of those games whose
(iv) Display the name of the gamne and prize money
prize money is known.
11 P.T.O.
91/
32. Mr. Mahesh is a Pythen Prograner working in a school. He kas to
maintain the records of the sports students. He has created a cay file
named sports.csv, to storethe details. The structure of sports.csvis
(sport_ id, competition, prize von]
where
sport id, is Sport id (integer)
competition is competition name (string)
prize won is ("Gold", "Silver", "Bronze")
Mr. Mahesh wants to write the following user-defined functions :
Add detail () : to accept the detail of a student and add to a csv file,
"sports.csv"
Count Medal () : to display the nane of competitions in which students
have won "Gold" medal.
Help him in writing the code of both the functions.

SECTION E 3x5=15

33. LogisticTechnologies Ltd. is a Delhibased organization which is expanding


its office set-up to Ambala. At Ambala office campus, they are planning to
have 3 different blocks for HR, Accounts and Logistics related work. Each
block has a number of computers, which are required to be connected to a
network for communication, data and resource sharing.
Ambala Office

Delbi HR Block Accounts Block


Head Ofice

Logistics Block

91/S 12
As a network consultant, you have to suggest the best network related
solutions for them for issues/problems raised in (i) to (v), keeping in mind
the distances between various block/locations and other given parameters.
Distances between various blockslocations :

HR Block to Accounts Blocks 400 meters

Accounts Block to Logistics Block 200 meters

Logistics Block to HR Block 150 meters

Delhi Head Office to Ambala Office 220 Km

Number of computers installed at various blocks are as follows:

HR Block 70

Accounts Block 40
Logistics Block 30

in
(i) Suggest the most appropriate block/location to house the SERVER
the Ambala office. Justify your answer.

(ii) Suggest the best wired medium to efficiently connect various blocks
within the Ambala office compound.
blocks
(iii) Draw an ideal cable layout (Block to Block)for connecting these
for wired connectivity.
conference between the
(iv) The company wants to schedule an online
used for
managers of Delhi and Ambala offices, Which protocol will be
effective voice communication over the Internet ?
Ambala
(v) Which kind of network will it be between Delhi office and
5
office ?

13 P.T.O.
91/S
34. (a) (i) What is the main purpose of seek () and tell () method?
(ii) Consider a binary file, Cinema.dat containing information in
the following structure :
[Mno, Mname, Mtype]
Write a function, search copy(), that reads the content from
the file Cinema. dat and copies all the details of the "Comedy"
movie type to file named movie.dat. 5
OR
(b) (i) Give one difference between write() and writeline ()
function in text file.
(i) ABinary file, "Items. dat"has the following structure:
[Icode, Description, Price]
Where
Icode - Item code
Description Detail of item
Price - Price of item
Write a function Add data (), that takes Icode,
Description and Price from the user and writes the
information in the binary file "Items .dat". 5
35. (a) () Define the term foreign key with respect to RDBMS.
(ii) Sangeeta wants to write a program in Python to delete the
record of a candidate "Raman" from the table named
Placement in MysQL database, Agency:
The table Placement in MySQL contains the follovwing
attributes :
CName- String
Dept String
Place- String
Salary - integer
Note the following to establish connectivity between Python
and MySQL:
Username - root
Password -job
Host- localhost
Help Sangeeta to write the program in Python for theabove
mentioned task. 5
OR

91/5 14
(b) (i) Give one difference between CHAR and VARCHAR datatype in
MySQL.
(ii) Rahim wants to write a program in Python to insert the
following record in the table named Bank Account in MySQL
database, Bank:
Accno-integer
Cname- string
Atype - string
Amount - float
Note the following to establish connectivity between Python
and MySQL:
Username - admin
Password- root
Host - localhost
Thevalues of fields Accno, Cname,
Cname Atype and Amount have
to be accepted from the user. Help Rahim to
in Python. write the program
5

You might also like