Grade-12 Re-5 QP
Grade-12 Re-5 QP
b) KeralaKerala d) Kerala
KarnatakaKarnataka KarnatakaKerala
ChennaiChennai GoaChennai
GoaGoa ChennaiGoa
11) _______ protocol provide access to command line interface on a remote computer. 1
a) FTP b) ppp c) Telnet d) SMTP
12) Consider the code given below: 1
b=100
def check(a):
________
b=b+a
print(a,b)
check(10)
print(b)
Which of the following statements should be given in the blank for #Missing
Statement, if the output produced is 110?
a) global a b) global b=100 c)global b d) global a=100
13) The process of tracking the programming errors is called_________________, 1
14) Which of the following columns in a table cannot be updated? 1
a) Date type columns in the table.
b) Columns which allows NULL values in the table.
c) A primary key column which also serves as foreign key reference in
another table.
d) All of these.
15) Name the transmission media best suitable for connecting to hilly areas. 1
16) Which of the following is not a legal method for fetching records from a 1
database from within a Python program?
(a) fetchone() b)fetchtwo() (c) fetchall() (d) fetchmany()
17) Q17 and 18 are ASSERTION AND REASONING based questions. 1
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
Assertion(A): CSV (Comma Separated Values) is a file format for data
storage which looks like a text file.
Reasoning(R): The information is organized with one record on each line and
each field is separated by semi-colon.
18) Assertion(A): If the arguments in a function call statement match the number 1
and order of arguments as defined in the function definition, such arguments
are called positional arguments.
Reasoning(R): During a function call, the argument list first contains default
argument(s) followed by positional argument(s).
SECTION – B 7*2=14
19) Write two points of difference between Bus topology and star topology. 2
OR
Write two points of difference between XML and HTML
20) Patra has written a code to input a number and check whether it is even or 2
odd number. His code is having errors. Rewrite the correct code and
underline the corrections made.
Def checkNumber(N):
status = N%2
return
#main-code
num=int( input(“ Enter a number to check :)).
k=checkNumber(num)
if k = 0:
print(“This is EVEN number”)
else:
print(“This is ODD number”)
21) i) Given is a Python string declaration: 2
message='FirstPreBoardExam@2022-23'
Write the output of: print(message[ : : -3].upper())
(OR)
ii) Write the output of the code given below:
d1={'rno':25, 'name':'dipanshu'}
d2={'name':'himanshu', 'age':30,'dept':'mechanical'}
d2.update(d1)
print(d2.keys())
22) Predict the output of the Python code given below: 2
L=[1,2,3,4,5]
Lst=[]
for i in range(len(L)):
if i%2==1:
t=(L[i],L[i]**2)
Lst.append(t)
print(Lst)
23) a) What are the two ways to add something to a list? How they are different? 2
(OR)
b) What are the two ways to remove something from a list? How are they different?
24) A MySQL table, sales have 10 rows. The following queries were executed on 2
the sales.
select count(*) from sales;
i) Display book name and author name and price of computer type books.
(ii) To increase the price of all history books by Rs 50.
(iii) Show the details of all books in ascending order of their prices.
(iv) To display book id, book name and quantity issued for all books which
have been issued.
(B) Write the command to view all tables in a database.
28) Write a function countINDIA() which read a text file ‘myfile.txt’ and print the 3
frequency of the words ‘India’ in it (ignoring case of the word).
Example: If the file content is as follows:
INDIA is my country. I live in India. India has many states.
The countIndia() function should display the output as:
Frequency of India is 3
OR
Write a function countVowel() in Python, which should read each character of a text
file “myfile.txt” and then count and display the count of occurrence of vowels
(including small cases and upper case).
Example:
If the file content is as follows:
INDIA is my country. I live in India. India has many states.
The countVowel() function should display the output as:
Total number of vowels are : 20
29) Write the output of the queries (i) to (vi) based on the table given below: 3
i) Select BRAND_NAME, FLAVOUR from CHIPS where PRICE <> 10;
(ii) Select * from CHIPS where FLAVOUR=”TOMATO” and PRICE > 20;
(iii) Select BRAND_NAME from CHIPS where price > 15 and QUANTITY < 15;
(iv) Select count( distinct (BRAND_NAME)) from CHIPS;
(v) Select price , price *1.5 from CHIPS where FLAVOUR = “PUDINA”;
(vi) Select distinct (BRAND_NAME) from CHIPS order by BRAND_NAME desc;
30) A list contains following record of a student: 3
[StudentName, Class, Section, MobileNumber]
Write the following user defined functions to perform given operations on the
stack named ‘xiia’:
(i) pushElement() - To Push an object containing name and mobile number of
students who belong to class xii and section ‘a’ to the stack
(ii) popElement() - To Pop the objects from the stack and display them. Also,
display “Stack Empty” when there are no elements in the stack.
For example: If the lists of students details are:
[“Rajveer”, “99999999999”,”XI”, “B”] [“Swatantra”, “8888888888”,”XII”, “A”]
[“Sajal”,”77777777777”,”VIII”,”A”] [“Yash”, “1010101010”,”XII”,”A”]
The stack “xiia” should contain
[“Swatantra”, “8888888888”]
[“Yash”, “1010101010”]
The output should be:
[“Yash”, “1010101010”]
[“Swatantra”, “8888888888”]
Stack Empty
SECTION - D 2*4=8
31) Consider the following tables ITEM and CUSTOMER. Write SQL queries for 4
the following statements.
Table : ITEM
Table : CUSTOMER
i) To display the details of these customers whose city is Delhi.
ii) To display the details of item whose Price is in the range of 35000 to 55000
(Both values included).
iii) To display the Cx_Name, City from table Customer and Item_Name and Price
from table ITEM, with their corresponding matching I_ID.
iv) To increase the Price of all items by 1000 in the table ITEM.
32) Write a Program in Python that defines and calls the following user defined 4
functions:
(i) ADD() – To accept and add data of a teacher to a CSV file ‘teacher.csv’.
Each record consists of a list with field elements as tid, name and mobile to
store teacher id, teacher name and teacher mobile number respectively.
(ii) COUNTRECORD() – To count the number of records present in the CSV
file named ‘teacher.csv’.
SECTION - E 3*5=15
33) Aryan Infotech Solutions has set up its new center at Kamla Nagar for its 5
office and web based activities. The company compound has 4 buildings as
shown in the diagram below:
i) Suggest a cable layout of connections between the buildings.
ii) Suggest the most suitable place (i.e. building) to house the server of this
organisation with a suitable reason
iii) Suggest the placement of the following devices with justification: a. Internet
Connecting Device/Modem b. Switch
iv) The organisation is planning to link its sale counter situated in various parts of the
same city, which type of network out of LAN, MAN or WAN will be formed? Justify
your answer.
v) What do your mean by PAN? Explain giving example
34) i)Differentiate between the following: (2+3)
a) f=open(‘diary.txt’,’r’)
b) f=open(‘diary.txt’,’w’)
ii) Arif takes a student’s details (rno, name and marks) and writes into a
binary file ‘stu.dat’
(OR)
i) Explain the use of ‘Foreign Key’ in a Relational Database Management
System. Give example
ii) Sumit wants to write a code and create a binary file ‘record.dat’ with employeeid,
ename and salary. The file contains 10 records. He has to update a record based on
the employee id entered by the user and update the salary.
The updated record is then to be written in the file ‘temp.dat.’
The records which are not to be updated also have to be written to the file’ temp.dat’.
If the employee id is not found, an appropriate message should be displayed.
Help him to write a code with the above criteria
35) i) What is Referential integrity? (1+4)
ii)Shabir wants to write a program in Python to insert the following record in
the table named Student in MYSQL database, SCHOOL:
∙ rno(Roll number )- integer
∙ name(Name) - string
∙ DOB (Date of birth) – Date
∙ Fee – float
Note the following to establish connectivity between Python and MySQL:
∙ Username - root
∙ Password - tiger
∙ Host - localhost
The values of fields rno, name, DOB and fee has to be accepted from the user.
Help Shabir to write the program in Python