CS QP Set-1
CS QP Set-1
CS (SET-1)
Instructions:-
●This question paper contains 37 questions.
●All questions are compulsory. However, internal choices have been provided in some
questions. Attempt only one of the choices in such questions
●The paper is divided into 5 Sections- A, B, C, D and E.
● Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
● Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
● Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.
● Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.
● Section E consists of 2 questions (36 to 37). Each question carries 5 Marks.
● All programming questions are to be answered using Python Language only.
● In case of MCQ, text of the correct answer should also be written.
PAGE NO. 1 OF 14
(B) Logical Error
(C) False
(D) True
PAGE NO. 2 OF 14
(D) print(str(dict))
9. Choose the correct statement from the following about a primary key (1)
column:
(A) Cannot have NULL values and can have UNIQUE values.
(B) Can have NULL as well as UNIQUE values.
(C) Cannot have NULL and cannot have UNIQUE values.
(D) Can have NULL but not UNIQUE values.
Update(50)
Update()
PAGE NO. 3 OF 14
14. What will be the output of the query? (1)
“SELECT name FROM student WHERE name like ‘%ar%’;
(A) Display name of students whose name ends with ‘ar’.
(B) Display details of students whose name ends with ‘ar’.
(C) Display name of students whose name has ‘ar’ anywhere in name.
(D) Display details of students whose name has ‘ar’ anywhere in name.
16. Which one of the following SQL clauses is always used in the end of (1)
any SQL query?
(A) WHERE
(B) ORDER BY
(C) HAVING
(D) GROUP BY
17. Which protocol is used for downloading & uploading files over the (1)
Internet?
(A) HTTP
(B) VoIP
(C) FTP
(D) SMTP
18. Which network device is used to make coming weak signals into (1)
strong and then forward?
(A) HUB
(B) SWITCH
(C) MODEM
PAGE NO. 4 OF 14
(D) REPEATER
Q20 and Q21 are Assertion (A) and Reason(R) 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.
20. Assertion(A): Default arguments in a function are used to assign values to (1)
such parameters in which values are not passed at the time of function call.
Reason(R): It is mandatory to have default values to all parameters coming
on right side of any default parameter in the function header.
22. What is the use of “in” operator? Identify from the following in which “in” (2)
operator may be used:-
“ONE”, (1), [1,2,3], 23
24. Consider the given below Lists L1 & L2 and answer the following (2)
using built-in function only:
PAGE NO. 5 OF 14
L1 = [10, 10, 20, 10, 30, 20]
L2 = [0, 1, 2, 1, 2, 0, 1]
1. (a) Write python command to delete last element from list L2.
OR
(b) Write python command to count 20 from list L1.
2. (a) Write python command to add [1, 0, 2] in the end of list L2.
OR
(b) Write python command to sort list L1 in ascending order.
(A) 30@
(B) 10@20@30@40@50@
(C) 20@30
(D) 40@30@
26. Rewrite the following code in Python after removing all syntax (2)
error(s). Underline each correction done in the code.
Y=integer(input(“Enter 1 or 10”))
if Y==10
for Y in range(1,11):
print(Y)
elseif Y<10:
for m in range(5,0,-1):
print(thank you)
PAGE NO. 6 OF 14
27. 1. (a) What constraint should be applied on a table column so that (2)
value entered by the user in that column must be in a specified range
of values not outside it?
OR
(b) What constraint should be applied on a table column so that the
column must not have NULL values & duplicate values?
2. (a) Write the SQL command to list the names of all the tables already
created in the database.
OR
(b) Write the SQL command to list the details(all column names, data
type, size, constraint) of a table “PLAYER”.
28. (A) Expand MODEM. Write the use of MODEM in networking. (2)
OR
(B) Expand XML. Write one benefit of XML over HTML.
29. Write a function COUNTLINES_ET() in python to read lines from a text (3)
file REPORT.TXT and COUNT those lines which are starting either
with ‘E’ and ‘T’ respectively. And display the Total count separately.
PAGE NO. 7 OF 14
For example : If the contents of the file are:
“THIS IS IMPORTANT TO NOTE THAT SUCCESS IS THE RESULT OF
HARD WORK. WE ALL ARE EXPECTED TO DO HARD WORK. AFTER
ALL, EXPERIENCE COMES FROM HARDWORK.”
30. (A) A stack named Emp_Stack that contains records of Employees. Each (3)
Employee record is represented as a list containing
[Emp_No, Emp_Name, Salary]
Write the following user-defined functions in Python to perform the specified
operations on the stack Emp_Stack:
(I) Push_Emp(Emp_Stack, New_Emp): This function takes the
stack Emp_Stack and a new employee record New_Emp as
arguments and pushes the new employee record onto the stack.
(II) Pop_Emp(Emp_Stack): This function pops the topmost
employee record from the stack and returns it. If the stack is
already empty, the function should display "Underflow".
(III) Peep(Emp_Stack): This function displays the topmost element
of the stack without deleting it. If the stack is empty, the function
should display 'None'.
OR
(B) A dictionary named D_STATE contains the record in the following
format:
{ Country : State }
Also, a stack name STATE(a list) will store the names of the states.
PAGE NO. 8 OF 14
(I) Push_State(D_STATE): It takes the dictionary as an argument
and pushes all the states in the stack STATE whose state name
is less than 10 characters.
(II) Pop_State(): This function pops the topmost state from the stack
STATE and returns it. Also, if the stack is already empty, the
function should display "Empty".
(III) Disp_State(): To display all elements of the stack STATE
without deleting them. If the stack is empty, the function should
display 'None'.
PAGE NO. 9 OF 14
32. Consider the table SURGERY as given below: (4)
SID SNAME FEES STARTDATE OTNO
S301 HEART 15000 2021-11-15 302
S302 LIMBS 9000 2021-10-20 NULL
S303 LEVER 10000 2023-07-02 301
S304 KIDNEY 5000 2024-08-01 NULL
S305 STOMOCH 18000 2024-03-25 302
33. A csv file "Population.csv" contains the population data of various cities. (4)
Each record of the file contains the following data:
● ID of the city
● Name of the city
● Population of the city
● Area(in sq. mtrs.) of the city
PAGE NO. 10 OF 14
For example, a sample record of the file may be:
[‘C001’, ‘Jaipur’, 697000, 5000]
Write the following Python functions to perform the specified operations on
this file:
(I) Read all the data from the file in the form of a list and display all
those records for which the population is more than 200000.
(II) Count & display the number of cities whose data is stored in the
file.
34. Write SQL commands for the following queries (i) to (iv) based on the (4)
relations TRAINER & COURSE given below:
35. A table, named PRODUCT, in PRO_DB database, has the following (4)
structure:
PAGE NO. 11 OF 14
Attribute Name Data Type
PID int(6)
PNAME Varchar(20)
COMPANY Varchar(20)
PRICE Float
PAGE NO. 12 OF 14
(III) Write a function in Python named DisplayAvgMarks(Sub) that
will accept a subject as an argument and read the contents of
TEST.dat. The function will calculate & display the Average of
the ScoredMarks of the passed Subject on screen
37. “VidyaDaan” an NGO is planning to setup its new campus at Nagpur for its (5)
web-based activities. The campus has four(04) UNITS as shown below:
PAGE NO. 13 OF 14
II. Suggest the most suitable place i.e. UNIT to install the server for the
above NGO.
III. Which network device is used to connect the computers in all
UNITs?
IV. Suggest the placement of Repeater in the UNITs of above network.
V. (A) NGO is planning to connect its Regional Office at Kota,
Rajasthan. Which out of the following wired communication, will you
suggest for a very high-speed connectivity?
(a)Twisted Pair cable (b) Ethernet cable (c) Optical Fiber
OR
(B) What type of network (PAN, LAN, MAN, or WAN) will be set up
among the computers connected in the NAGPUR campus?
***************
PAGE NO. 14 OF 14