Professional Documents
Culture Documents
CS Set 1 QP
CS Set 1 QP
ASSOCIATION
SECTION- A
Sl. No Question M
1 State True or False: 1
“In a Python program, the variable declaration is implicit”
2 Select the DDL command from the following: 1
a) SELECT
b) INSERT
c) DELETE
d) DROP
3 What will be the output of the following statement 1
print(46%2**3+4/11)
a) 6
b)6.0
c)6.3
d)6.5
1
4 Predict the correct output of the code: 1
5 Which of the following will display information about all the employee table, whose 1
names contains second letter as "S"?
(a) SELECT * FROM EMP WHERE NAME LIKE "_S%";
(b) SELECT * FROM EMP WHERE NAME LIKE "%S_";
(c) SELECT * FROM EMP WHERE NAME LIKE "_ _S%";
(d) SELECT * FROM EMP WHERE NAME="S%"
6 Rearrange the following terms in increasing order of data transfer rates. 1
Gbps, Mbps, Tbps, Kbps, bps
7 Which of the following will delete key-value pair for key = “Orange” from a dictionary 1
D1?
a. delete D1("Orange")
b. del D1["Orange"]
c. del.D1["Orange"]
d. D1.del["Orange"]
8 Vamshi creates many tables under the database named “Exam”, now she wants to list 1
out all the tables created in that. Write a SQL query to execute the above condition.
9 Which of the following statement(s) would give an error during execution of the 1
following code?
tup = (20,35,45,50,85,80)
print(tup[1]) #Statement 1
tup[2]=25 #Statement 2
print(tup[3]+50) #Statement 2
print(min(tup)) #Statement 3
tup[4]=80 #Statement 4
Options:
a. Statement 1 & statement 2
b. Statement 2
c. Statement 3
d. Statement 2 & statement 4
10 Out of the following, which is the costliest wired and wireless medium of transmission? 1
Infrared, Coaxial cabel, optical fibre microwave, satellite,twisted pair cable.
11 Identify the type of network 1
2
12 Mr. Soman created a table named “Student” with the fields Rollno, Student_name, Class, 1
and Section. He entered several rows into the table. When he displayed the entered rows,
he found that Rollno’s were duplicated without knowing it. If you were in Soman’s
position, what type of constraints would you apply to avoid the above data redundancy?
13 State whether the following statement is True or False: 1
An exception may be raised even if the program syntax is wrong.
14 The UPDATE SQL clause can 1
a) Update only one row at a time
b) Update more than one row at a time
c) Delete more than one row at a time
d) Delete only one row at a time
15 A client server network is also called as ___________. 1
a) Peer-to-peer network
b) Master-Slave network
c) Dedicated
d) Non-dedicated
16 Mention the modes in which the file pointer is at the end of the line. 1
Q17 and 18 are ASSERTION AND REASONING 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
17 Assertion (A) : Default arguments in Python functions should always be placed before 1
non-default arguments in the function signature.
Reasoning(R): Placing default arguments before non-default arguments ensures that the
function can be called without specifying values for the default arguments if needed.
3
18 Assertion (A) : Fiber-optic cables are considered superior to twisted-pair cables for 1
high-speed data transmission.
Reasoning (R) : Fiber-optic cables use light signals to transmit data, which can travel
at higher speeds and over longer distances compared to the electrical signals used in
twisted-pair cables.
SECTION - B
19 i. Write the full form of 1+1=2
a. SMTP
b. PPP
ii. Mention the use of TELNET.
(OR)
i. Expand the following terms:
VOIP, TCP
ii. Mention one difference between PAN and LAN
23 Write the Python statement for each of the following tasks using BUILT-IN 1+1=2
functions/methods only:
(i) To insert an element 400 at the fourth position, in the list L1.
4
(ii) To check whether a string named, message ends with a full stop / period or not.
SECTION- C
26 Deduce the output of the following python code: 3
5
27 A vegetable store “Fresh Stock” maintains the inventory using a SQL table. The table is 3
given below for your view.
6
iii. SELECT Name , Department, Salary WHERE Department NOT IN
Mathematics;
30 Mr. Ajay is a student in grade XII who is a budding programmer in Python. His teacher 3
assigns a task to him: accept a string from the user and create a user-defined function,
INSERT(), that inserts only the uppercase letters present in the string. He also wants to
display the inserted values. Help him by developing a code to perform the above tasks
using data structure.
SECTION- D
31 Write the output of the queries (i) to (iv) based on the table, TECH_COURSE given 1*4=4
below:
7
Distance between the buildings:
• Building Ravi to Jamuna → 120 m
• Building Ravi to Ganga → 50 m
• Building Ganga to Jamuna → 65 m
• Faridabad campus to Head Office → 1460 km
Number of Computers:
• Building Ravi → 25 Nos.
• Building Jamuna → 150 Nos.
• Building Ganga → 51 Nos.
• Head Office → 10 Nos.
a) Suggest the most suitable place to house the server of this organization. Also
give a reason to justify your suggested location.
b) Suggest a cable layout of connections between the buildings inside the campus.
c) Suggest the placement of the following devices with justification:
• Switch
• Repeater
d) The organization is planning to provide a high speed link with its head office
situated in KOLKATA using a wired connection. Which of the following device
will be most suitable for this job?
i. Optical Fiber
ii. Co-axial cable
iii. Ethernet cable
e) The organization is planning to connect its Head office with Faridabad campus.
Which type of network out of LAN, MAN, or WAN will be formed? Justify
your answer.
8
Write a function, copy(), that reads contents from the file CINEMA.DAT and copies the
records with Movie name as “ KAALAI” to the file named CINEMA.DAT. The function
should return the total number of records copied to the file CINEMA.DAT.
(OR)
i) Differntiate seek() and tell() methods in python.
ii) A Binary file, CINEMA.DAT has the following structure:
{MNO:[MNAME, MTYPE]}
Where
MNO – Movie Number
MNAME – Movie Name
MTYPE is Movie Type
Write a user defined function, findType(mtype), that accepts mtype as parameter and
displays all the records from the binary file CINEMA.DAT, that have the value of
Movie Type as mtype.
35 a) Write the output of the code given below: 2+3
def printMe(q,r=2):
p=r+q**3
print(p)
#main-code
a=10
b=5
printMe(a,b)
printMe(r=4,q=2)
b) The code given below inserts the following record in the table Student:
Rollno- integer
Name-Varcahr(30)
Class- integer
Marks- Integer
9
clas=int(input("Enter class :: "))
marks=int(input("Enter Marks :: "))
querry="insert into student values({},'{}',{},{})".format(rno,name,clas,marks)
______________________ #Statement 2
______________________ # Statement 3
print("Data Added successfully")
(OR)
b) The code given below inserts the following record in the table Student:
Rollno- integer
Name-Varcahr(30)
Class- integer
Marks- Integer
Note the following to establish connectivity between Python and MySQL:
* Username is root
* Password is toor@123
* The table exists in a “stud” database.
Write the following missing statements to complete the code:
Statement 1 – to form the cursor object
Statement 2 – to execute the query that extracts records of those students whose marks
are greater than 90.
Statement 3- to read the complete result of the query (records whose marks are greater
than 90) into the object named data, from the table student in the database.
10
______________________ #Statement 2
data=__________________ #Statement 3
for i in data:
print(i)
print()
11