0% found this document useful (0 votes)
32 views16 pages

Computer Science

This document is a question paper for a Computer Science exam, containing 37 questions divided into five sections with varying marks. It includes general instructions for candidates regarding the structure of the paper and the rules for answering questions. The questions cover topics such as Python programming, SQL commands, and data structures.

Uploaded by

erseema26
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)
32 views16 pages

Computer Science

This document is a question paper for a Computer Science exam, containing 37 questions divided into five sections with varying marks. It includes general instructions for candidates regarding the structure of the paper and the rules for answering questions. The questions cover topics such as Python programming, SQL commands, and data structures.

Uploaded by

erseema26
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/ 16

Series: ZYWIX SET - 4

teri.
Roll No. Q.P. Code
91

2cs|2ss
Candidates must write the Q.P. Code on
thetitle page of the answer-book.

COMPUTER SCIENCE
rfeA4 H5:70
Maximum Marks: 70
Timeallowed : 3 hours

fers 15 tu42 GI H44 T<T TATI2A-47 T faqy gafs 10. 15


34 4-yg YA

check that this question paper contains 31l printed pages.


Please
contains 37 questions.
Please check that this question paper paper should be
hand side of the question
Q.P. Code given on the right answer-book candidate
the by the
written on the title page of answer
number of the question in the
Plesse write down the serial attempting it.
before
book at the given place read this question paper. The guestion
has been allotted to
18 minute time a.m. From 10.15 a.m. to 10.30 a.m., the
distributed at 10.15
will be
paper
read the question paper only and will not write any answer
candidates will
during this period.
answer-book
on the
Page 1 of 32 P.T.0.
91 785
General Instructions:

() This question paper contains 37 questions.


(i) All questions are compulsory. However, internal choices have been
provided in some questions. Attempt only one of the choices in sucn
questions.
(ii) The paper is divided into5 Sections - A,B, C, Dand E.
(iv) Section A, consists of 21 questions (1 to 21). Each question carries
Imark.
(u) Section B, consists of 7 questions (22 to 28). Each question carries
2 marks.
Each question carries
(vi) Section C, consists of 3 guestions (29 to 31).
3 marks.
to 35). Each question carries
(vii) Section D, consists of 4 questions (32
4 marks.
carries
questions (36 & 37). Each question
(viii) Section E, consists of 2
5 marks.
questions are to be answered using Python Language
ix) All programming
only. written.
text of the correct answer should also be
(*) In case of MCQs,

SECTION -A
(21 x 1= 21)

l, State True or False : of same data type."


its elements
always contain all
A Python List must
1
following statement
?
output of the
What will be the
print (14$3**2*4)
(B) 64
(A) 16 (D) 256
P.T.0.
(C) 20
Page 3 of 32
TÄentify the correct output of the following code snippet : 1
3.
game="Olympic2024"
print (game. index ("C"))
(A) 0 (B) 6

(C) -1 (D) ValueError

1
4 Which of the following is the correct identifier ?
global (B) Break
(A)
(C) def (D) with

1
following options :
6. Identify the invalid Python statement out of the
print ("A" ,10,end="*") (B) print ("A" , sep="*",1)
(A)
print ("A",10,sep="*") (D) print ("A" *10)
(C)

output
the statements given below and then choose the correct
6. Consider 1
from the given options :
L=['TIC', TAC']

print (L[::-1])
(B) ['TIC', 'TAC']
'CIT', 'CAT']
(A)
(D) ['TAC', "TIC']
'CIT']
(C) ['CAT' ,

variable on either
evaluates to True if the
following operator
7 Which of the memory location and False
points towards the same
operator
side of the
otherwise ? (B) is not

(A) is (D) or
P.T.0.
(C) and

Page 5 of 32
91
Consider the statements given below and then choose the correct output
from the given options : 1
D={'S01' :95, 's02':96 )
for I in D :
print(I,end=' #')
(A) S01#s02# (B) 95#96#
(C) sO1,954s02,96# (D) so1#95#S02#96#

9. While creating a table, which constraint does not allow insertion of 1


duplicate values in the table ?
(A) UNIQUE (B) DISTINCT
(C) NOT NULL (D) HAVING

10. Consider the statements given below and then choose the correct output
1
from the given options :
def Change (N):
N=N+10
print (N, end='$$')
N=15
Change (N)
print (N)
(A) 25$$15 (B) 15$$25
(C) 25$$25 (D) 2525$$

11. Consider the statements given below and then choose the correct output
1
from the given options :
N='5!
try:
print('WORD' + N, end='#)
except:
print('ERROR',end='#")
finally:
print('OVER')
(B) WORD5#OVER
(A) ERROR#
(D) ERROR{OVER
(C) WORD5# P.T.0.
91 Page 7 of 32
1
. Which of the following built-in function/method returns a dictionary?
(A) dict () (B) keys ()
(C) values () (D) 1tems ()

1
SQL?
13. Which of the following is a DML command in
UPDATE
(B) CREATE
(A)
(D) DROP
(C) ALTER

displays the number of values


in the
function in SQL
14. Which aggregate 1
NULL values ?
specified column ignoring the
(B) count ()
(A) len ()
(D) nm ()
(C) number ()

should not be enclosed within quotation


type of value
15. In MYSQL, which
1

marks ?
(B) VARCHAR
(A) DATE
(D) CHAR
FLOAT Sup
(C)
1

16. State True or False : 5 rows and


columns, and table B has
6 rows and 3 have 30 rows and
If table A has A and B will
Cartesian product of
2 columns, the
5 columns.
regenerate and
is used to
devices
networking

17. Which of the following


ahead ?
transmit the weakened signal Ethernet Card
(B)
P.T.0.
(A) Hub Modem
(D)
(C) Repeater Page 9 of 32
91
18. Which of the following options is the correct protocol used for phone calls
1
Gver the internet ?

(A) PPP (B) FTP

(C) HTTP .(D) VoIP

1
19. Expand ARPANET. Afane Reiearch.
NeturR.
Projeet
ngert
Reason R) based questions. Mark
(A) and
Q. Nos. 20 and 21 are Assertion
the correct choice as
Reason (R) are true and Reason (R) is the
Both Assertion (A) and
(A)
Assertion (A).
correct explanation for
the
Reason (R) are true and Reason (R) is not
(B) Both Assertion (A) and
correct explanation for Assertion (A).
Reason (R) is false.
(C) Assertion (A) is true but,
Reason (R) is true.
Assertion (A) is false but,
(D)

using mode, the


binary file opened
Assertion (A) : For a 1
20. () method will display an error.
pickle. dump

dump () method is used to read from a


pickle.
The
Reason (R)
binary file.

in
records from more than one table
retrieve
(A) : We can 1
21. Assertion
MYSQL.
relationship between
establish a
. Forejign key is used to
Reason (R)
two tables.
P.T.0.
32
Page 11 of

91
SECTION - B (7 x 2= 14)
99 What does the return statement do in a function 2 Explain with the help
2
of an example.

2
23. Write one example of each of the following in Python :
(i) Syntax Error
(ii) Implicit Type Conversion
2
24. Consider the following dictionaries, D and Dl:
D={"Suman": 40, "Raj":55, "Raman": 60}
D1={ "Aditi" :30, "Amit" :90, "Raj":20}
(Answer using built-in Python functions only)
corresponding to
(a) Write a statement to display/return the value
(1)
the key "Raj" in the dictionary D.
OR
D1.
Write a statement to display
the length of the dictionary
(b)
statement to append all the key-value pairs of the
(ii) (a) Write a
dictionary D to the dictionary D1.
OR
"Amit"
delete the item with the given key
(b) Write a statement to
from the dictionary D1.

options is expected to be displayed


from the given 2
25. What possible output
code is executed ?
when the following
import random
Cards=["Heart", "Spade","Club", "Diamond"]

for i in range (2) : end="#")


[random. randint (1,i+2)] ,
print (Cards Spade#Heart#
(B)
(A) Spade#Diamond# . Heart#Spade# y
(D)
(C) Diamond}Club# y P.T.0.
Page 13of
32
91
The code given below accepts N as an integer argument and returns the
26. sum of all integers from 1 to N. Observe the following code carefully and
rewrite it after removing all syntax and logical errors. Underline all the
corrections made. 2

def Sum (N)

for I in range (N) :


S=S+I
return S

print (Sum (10)

maintaining the staff data of an


27. Nisha is assigned the task of
organization. She has to store the
details of the staff in the SQL table
DEPARTMENT,
attributes as EMPNO, NAME,
named EMPLOYEES with Number, Name,
Employee's Identification
BASICSAL to store
respectively. There can be two or more
Department, and Basic Salary 2
Employees with the same name
in the organization.
which should be
Nisha to identify the attribute
(i) (a) Help Justify your answer.
as the PRIMARY KEY.
designated
OR
applied
identify the constraint which should be
(b) Help Nisha to Employees' Names cannot
NAME Such that the
to the attribute have
NULL while entering the records but can
be left empty or
duplicate values.
change the size of the attribute
SQL command to
(ii) (a) Write the EMPLOYEES to allow the maximum
inthe table
BASICSAL
in it.
99999.99 to be stored
value of
OR
command to delete the table EMPILOYEES.
SQL
Write the
(b)
URL.
explain the term
28. (a) Expand and
OR
PPP ?
PPP. What is the use of
the term P.T.0.
(b) Expand
Page l5 of
32
91
SECTION - C (3 x 3 = 9)

29. (a) Write a Python function that displays all the lines containing the
word 'vote' from a text file "Elections. txt". For example, if
the file contains : 3
In an election many people vote to choose their representative.
The candidate getting the maximum share of votes stands elected.
Normally, one person has to vote once.
The process of voting may vary with time and region.
Then the output should be:
In an election many people vote to choose their representative.
Normally, one person has to vote once.
OR
(b) Write a Python function that displays all the words starting and
ending with a vowel from a text file "Report. txt". The consecutive
words should be separated by a space in the output. For example, if
the file contains :
Once there was a wise man in a village.
He was an awesome story-teller.
He was able to keep people anchored while listening to him.
Then the output should be:
Once a a awesome able

30. (a) A stack, named Clrstack, contains records of some colors. Each
record is represented as a tuple containing four elements
ColorName, RED GREEN, BLUE. ColorName is a string, and
RED GREEN, BLUE are integers. For example, a record in the
stack may be ('Yellow' 237, 250, 68) 3x 1= 3
Write the following user-defined functions in Python to perform the
specified operations on ClrStack:
takes the
(i) push Clr (ClrStack, new Clr) : This function
stack ClrStack and a new record new Clr as arguments and
stack.
pushes this new record onto the
(iü) pop Clr (ClrStack) : This function pops the topmost record
from the stack and returns it. If the stack is already empty, the
function should display the message "Underflow".
the stack
(iü) isEmpty (ClrStack) : This function checks whether
function should return
is empty. If the stack is empty, the return False
True, otherwise the function should
OR
Page 17 of 32 P.T.O.
91
(b) Write the following user-defined functions in Python :
(i) Push_trail (N, myStack): Here N and mys tack are lists, and
myStack represents a stack. The function should push the last
5 elements from the list N onto the stack mystack. For
example, if the list N is [1,2,3,4,5,6, 7] , then the function
push_trail () should push the elements 3,4,5,6,7 onto the
stack. Therefore the value of stack willbe (3, 4,5,6,7].
Assume that N contains at least 5 elements.

(11) poP_one(myStack): The function should pop an element


from the stack myS tack, and return this element. If the stack
is empty, then the function should display the message 'Stack
Underflow',and return None.
all the
(iii) display_all(mystack): The function should display the
elements of the stack myStack, without deleting them. If
stack is empty, the function should display the message
'Empty Stack'

3
31. (a) Predict the output of the following code :
def ExamOn (mystr) :
newstr

countt = 0

for i in mys tr:


if countt2 != 0:

newstr = newstr + str (count-1)

else:
newst r = newstr + i.lower
0

Coun t += 1
[:21
newst r = news t r + mystr
string is:", newstr)
Print ("The new
ExamOn ("Genx")

OR
P.T.0.
Page 19 of 32
91
(b) Write the output on execution of the following Python code:
def Change (X) :
for K,V in X.items () :
L1.append (K)
L2.append (V)
D={1;" ONE",2: "TWO",3:"THREE")
Ll=[]
L2=[]
L2

Change (D)
print (L1)
print (L2)
print (D)

SECTION -D (4 x 4 = 16)

32. Suman has created a table named WORKER with a set of records to
maintain the data of the construction sites, which consists of
WID,
WNAME, WAGE, HOURS, TYPE, and sITEID. After creating the table,
she entered data in it, which is as follows :
4
WID WNAME WAGE HOURS TYPE SIEID
WO1 Ahmed J 1500 200 Unski1led 103
W11 Naveen S h 520 100 Skilled 101
WO2 Jacob B 780 95 Unskilled 101
W15 Nihal K 560 110 Semiskilled NULL
W10 Anju S 1200 130 Skilled 103
91 Page 21 of 32 P.T.0.
(a) Based on the data given above, answer the following questions:
1) Write the SQL statement to disply the names and wages of
those workers whose wages are between 800 and 1500.
(iü) Write the SQL statement to display the record of workers
whose SITEID is not known.
(iii) Write the SQL statement todisplay WNAME, WAGE and HOURS of
all those workers whose TYPE is ' Skilled'.
(1v) Write the SQL statement to change the WAGE to 1200 of the
workers where the TYPE is "Semiskilled".
OR
(b) Considering the above given table wORKER, write the output on
execution of the following sQL commands :
) SELECT WNAME, WAGE*HOURS FROM WORKER WHERE
SITEID = 103;
(i1) SELECT COUNT (DISTINCT TYPE) FROM WORKER;
iii) SELECT MAX (WAGE), MIN (WAGE), TYPE FROM WORKER
GROUP BY TYPE;
(iv) SELECT WNAME,SITEID FROM WORKER WHERE
TYPE"Unskilled" ORDER BY HOURS ;

in a hospital.
33. A csv file "P record. csv" contains the records of patients 4
Each record of the file contains the following data:
Name of a patient
Disease
Number of days patient is admitted
Amount
the file may be :
For example, a sample record of
["Gunjan", "Jaundice",4,150001

specified operations
Write the following Python functions to perform the
on this file :
the data from the
(i) Write a function read data () which reads all
Cancer' patients.
fle and displays the details of allthe '
counts and returng the
(ü) Write a function count rec() which
file.
number of records in the
Page 23 of 32 P.T.0.
91
34. Assume that you are working in the IT Department of a Creative Art
Gallery (CAG),which sells different forms of art creations like Paintings,
Sculptures etc. The data of Art Creations and Artists are kept in tables
Articles and Artists respectively. Following are few records from
thesetwo tables: 4 x 1 = 4

Table: Articles
Code | A Code I Article DOC Price
PL001 A0001 Painting 2018-10-19 20000

SC028 A0004 Sculpture 2021-01-15 16000

QL005 | A0003 Quilling ! 2024-04-24 3000

Table: Artists
A Code Name Phone Email DOB
+ -+ ---.-.
j A0001 Roy 595923 cCrAG.Com 1986-10-12
I A0002 Ghosh 1122334 !ghosh@CrAG. com ! 1972-02-05 !
A0003 Gargi 121212 Gargi@CrAG. com 1996-03-22
A0004 Mustafa 33333333 |M£@CrAg. com 2000-01-01
Note : The tables contain many more records than shown here.
" DOC is Date of Creation of an Article.
As an employee of CAG, you are required to write the SQL queries for the
following :
(1) To display all the records from the Articles table in descending
order of price.
(i) To display the details of Articles which were created in the year
2020.

(iii) To display the structure of Artiststable.


(iv) (a) To display the name of all artists whose Article is Painting
through Equi Join.
OR
(b) To display the name of all Artists whose Article is 'Painting'
through Natural Join.
91 Page 25 of 32 P.T.0.
35. Atable, named THEATRE, in CINEMA
database, has the following structure : 4
Field
Type
Th ID
char (5)
|Name Ivarchar (15)
|City varchar (15)
Location varchar (15)
Seats int

Write a function Delete Theatre (), to input the value of Th ID from


the user and permanently delete the corresponding record from the table.
Assume the following for Python-Database connectivity:
Host : localhost, User:root, Password : Ex2025

SECTION - E (2 x 5 = 10)
36. A file, PASSENGERS. DAT, stores the records of passengers
using the
following structure : 5
(PNR, PName, BRDSTN, DESTN, FARE]
where:
PNR Passenger Number (string type)
PName Passenger Name (string type)
BRDSTN Boarding Station Name (string type)
DESTN Destination Station Name (string type)
FARE Fare amount for the journey (float type)
Write user defined functions in Python for the following tasks:
) Create () - to input data for passengers and write it in the binary
file PASSENGERS.DAT.

(ü) SearchDestn (D) to read contents from the file PASSENGERS. DAT
and display the details of those Passengers whose DESTN matches
with the value ofD.

(iüi) Update Fare () - to increase the fare of all passengers by 5% and


rewrite the updated records into the file PASSENGERS.DAT. Q

91 Page 27 of 32 P.T.O.
37. 'Swabhaav is a big NGO working in the field of
Psychological Treatment
and Counselling, having its Head Office in Nagpur. It is
planning to set
up a center in Vijayawada. The Vijayawada Center will have four blocks
ADMIN, PSYCHIATRY, PSYCHOLOGY, and ICU. You, as a Network
Expert; need to suggest the best network-related solutions for them to
resolve the issues/problems mentioned in questions (i) to (v), keeping the
following parameters in mind : 5x1=5

ADMIN PSYCHOLOGY
Block Block

Vijayawada Center
PSYCHIATRY ICU
Block Block

Block to Block distances (in metres) :


From To Distance
ADMIN PSYCHIATRY 65 m

ADMIN PSYCHOLOGY 65 m
ADMIN ICU 65 m
som
PSYCHIATRY PSYCHOLOGY 100 -m
PSYCHIATRY ICU 50 m

PSYCHOLOGY ICU 50 m

Distance of Nagpur Head Office from Vijayawada Center = 700 km


Number of Computers in each block is as follows :
Block No. of Computers
ADMIN 16

PSYCHIATRY 40

PSYCHOLOGY 19

ICU 20
P.T.0.
91 Page 29 of 32
DA

()Suggest the most appropriate location of the server inside the


Vijayawada Center. Justify your choice.
(ii)Which hardware device will you suggest to connect all the
computers within each block of Vijayawada Center?
(ii) Draw a cable layout to efficiently connect various blocks within the
Vijayawada Center.
(iv) Where should the router be placed to provide internet to all
the
computers in the Vijayawada Center ?
(v) (a) The Manager at Nagpur wants to
remotely access the computer
in Admin block in Vijayawada. Which protocol will
be used for
this ?

OR
(b) Which type of Network (PAN, LAN,
MAN or WAN will be set
up among the computers connected with
Vijayawada Center ?

91 Page 3l of 32

You might also like