0% found this document useful (0 votes)
444 views

Sample Paper 1 For Solving

The document provides instructions for a mock examination including section details, general instructions, and sample questions. It contains 18 single mark questions in Section A testing concepts like Python data types, file handling, SQL, and networking. Section B has 7 two mark questions involving errors in code snippets, differences between protocols, and short descriptions. Section C contains 5 three mark short answer questions that may involve tables, concepts, or code snippets.

Uploaded by

Aamir
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)
444 views

Sample Paper 1 For Solving

The document provides instructions for a mock examination including section details, general instructions, and sample questions. It contains 18 single mark questions in Section A testing concepts like Python data types, file handling, SQL, and networking. Section B has 7 two mark questions involving errors in code snippets, differences between protocols, and short descriptions. Section C contains 5 three mark short answer questions that may involve tables, concepts, or code snippets.

Uploaded by

Aamir
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

MADURAI SAHODAYA SCHOOLS COMPLEX

&
COIMBATORE SAHODAYA SCHOOLS COMPLEX
AISSE/AISSCE
COMMON MOCK EXAMINATION
ACADEMIC YEAR 2022-23
SET – A

ROLL NUMBER : SUBJECT CODE : 083

GRADE : __________________ SUBJECT: ________________

DATE :____________________ DAY : ___________________

MAX MARKS:________________ TIME : ____________________

GENERAL INSTRUCTIONS

1. This question paper contains five sections, Section A to E.


2. All questions are compulsory.
3. Section A have 18 questions carrying 01 mark each.
4. Section B has 07 Very Short Answer type questions carrying 02 marks each.
5. Section C has 05 Short Answer type questions carrying 03 marks each.
6. Section D has 03 Long Answer type questions carrying 05 marks each.
7. Section E has 02 questions carrying 04 marks each. One internal choice is given in Q35
against part c only.
8. All programming questions are to be answered using Python Language only.

SECTION A
1. Consider the given expression: 1
0 and 14 or not 12 or 0
Which of the following will be correct output if the given expression is
evaluated?
a) 0 b) False c) 1 d) True
2. Identify the incorrect variable name: 1
a) type b) local c) as d)eval
3. What will be the data type of the expression: not 0 or 1? 1
a) bool b) int c) float d) error
4. What will be the output of the following code: 1
1
a={'Sun':1,'Mon':2,'Tue':3,'Wed':4}
a[a.popitem()]='What?'
a) {'Sun': 1, 'Mon': 2, 'Tue': 3, 'Wed': 'What?'}
b) {'Sun': 1, 'Mon': 2, 'Tue': 3, ('Wed', 4): 'What?'}
c) {'Sun': 1, 'Mon': 2, 'Tue': 3, 4: 'What?'}
d) {'Sun': 1, 'Mon': 2, 'Tue': 3}
5. Select the correct output of the code: 1
a=’welcome to all’
a=a.partition('l')
print(a[2][:])
a) me to all
b) come to a
c) come to all
d) come to al
6. Fill in the blank: 1
f=open(‘hello.txt’,_____)
f.seek(5,1)
f.close()
a) r b)rb c)r+ d)w
7. Fill in the blank: 1
_________ command is used to remove unique key from the table in
SQL.
a) drop b) remove c) drop index d) alter
8. Select the correct statement, with reference to RDBMS: 1
a) NULL can be a value in a Primary Key column
b) '' (Empty string) can be a value in a Primary Key column
c) A table with a Primary Key column cannot have an alternate key.
d) A table with a Primary Key column must have an alternate key.
9. seek() is a method of: 1
a) File object b) csv module c) pickle module d) math module
10. What will the following expression be evaluated to in Python? 1
print(1.0%6**3+2.0//7)
a) 0 b) 0.0 c)1 d)1.0
11. Which of the following network protocol used to transfer files from one 1
host to another host over a TCP-based network?
a) TCP/IP b)VoIP c) FTP d)POP

2
12. Which of the following statement(s) given an error during execution: 1
Suppose a contains ‘welcome to all’,.
a=’welcome to all’, # statement 1
a+=(110) # statement 2
a*=2 # statement 3
a=a[0][:7]+a[0][11:] # statement 4

a) Statement 1
b) statement 2
c) statement 2 and 3
d) statement 2 and 4
13. In context of Python - Database connectivity, the function rowcount() 1
is a method of which object?
a) connection b) database c) cursor d) query
14. A text file “muthu.txt” is stored on a computer. Identify the correct 1
option out of the following options to open the file for reading.
i) f=open(“muthu.txt”)
ii) f=open(“muthu.txt”,’r’)
iii) f=open(“muthu.txt”,’rb’)
iv) f=open(“muthu.txt”,’r+b’)
a) (i),(ii) and (iv)
b) (ii) and (iv)
c) (i) and (ii)
d) (i),(ii) and (iii)
15. Which of the following command is used to SELECT only one copy of 1
each set of duplicate rows?
a) DISTINCT
b) UNIQUE
c) PRIMARY
d) COUNT
16. A text file is opened using the statement f=open(“muthu.txt”). The file 1
has a total of 5 lines. Which of the following options will be true if
statement 1 and 2 are executed in order?
Statement 1: a1=f.readline(5)
Statement 2: a2=f.readlines()
a. a1 will be a string and a2 will be a list with 1 element.

3
b. a1 will be a list and a2 will be a string.
c. a1 will be a string and a2 will be a list with 5 element.
d. a1 and a2 both are string.
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) : The seek() method is used to change the position of the 1
file pointer.
Reason(R) : Offset mode can have any of the two values 0 and 1.
18. Assertion(A): Assertion (A): If L is a list, then L+=range(0,5,2) is an 1
invalid statement.
Reason (R): Only a list can be concatenated to a list.
SECTION B
19 Find the error(s) in the following code snippet and write the corrected 2
code.
STRING=”welcome to all”
N=””
for S in range(0:8)
if STRING(S)=’aeiou’
print(S(STRING))
else:
printf(“NO”)
20 a) Write two points of difference between HTTP and HTTPS. 2
OR
b) Write two points of difference between packet switching and
circuit switching.
21 (a) Given is a Python string declaration: 1
a=’sadhana-mdu'
Write the output of: print(a[0:15][0:len(a):2][::2])
OR 1
(b) Write the output of the code given below:
d1 = {"name": "karan T", 'age': 17}

4
a=d1.setdefault('age',18)
d1.update({"Age":18})
print(d1,a,sep='$')
22 What do you understand by Candidate Keys in a table? Give a suitable 2
example of Candidate Keys from a table containing some meaningful
data.
23 (a) Write the full forms of the following : 1
(i) ARPANET ii)VoIP
(b) Which type of network (out of LAN, PAN and MAN) is formed, 1
when you connect two mobiles using Bluetooth to transfer a
video?
24 Predict the output of the Python code given below: 2
def hello():
a=['MDU','MS','CGL','TBM']
k=-1
for i in ['MDU','MS','CGL','TBM'][:-2]:
if i in ['A','E','I','O','U']:
a[k]=['MDU','MS','CGL','TBM'][k]
k+=1
else:
a[k]=['MDU','MS','CGL','TBM'][k]
k-=1
print(a)
hello()
OR
t1= ['CS','IP','IT']
list1=t1
new_list = []
for i in list1:
if t1.index(i) %2 !=0:
new_list.append(t1.pop())
elif t1.index(i) //2 ==0:
new_list.append(t1.insert(len(t1)-1,t1.pop()))
print(new_list,list1,t1,sep='#')
25 If a column marks in a table student has 6 entries, viz. 2
90,89,NULL,98,98,NULL then what will be the output of the following

5
query?
SELECT COUNT(DISTINCT(MARKS)),COUNT(MARKS) FROM STUDENT;
SETCTION C
26 (a) Consider the following table structure: 1+2
Table :Student
FIELD TYPE NULL KEY
ROLLNO CHAR(5) NO PRIMARY
SNAME VARCHAR(10) NO NOT NULL
AGE INT(5) YES UNIQUE
(i) Write a SQL query to remove unique constraints
from the table.
(b) Consider the following table:
Table : XII_A
Rollno Sname Age Dob Stream
A01 Karan 16 1/12/2007 PCMC
A02 Charudharsan 15 24/04/2006 BS
A03 Diwahar 16 20/03/2007 BS
A04 Jiffin 16 10/10/2006 PCMB
A05 Karthikeyan 15 1/2/2006 BS
(i) Select sname,stream from XII_A having stream like ‘%B%’;
(ii) Select stream, count(*) from XII_A group by stream having
count(Stream)<=1;
(iii) Select Age, Stream from XII_A where Age between 15 and
15 order by sname;
(iv) Select Rollno, Stream from XII_A where Stream like ‘P%B’
and stream <>’BS’;
27 Write a method NO_VOWELS_WORDS() in Python to read the content 3
of a text file and count how many words contains vowels characters in
the file.
Example: If the file content is as follows:
My first book was
Me and My Family.
It gave me chance to be
Known to the world.
The NO_VOWELS_WORDS() function should display the output as: No.
of such words: 2

6
OR
Write a function COUNTWORD( ) which counts all the words from the
text file WELCOME.txt whose length is more than 7 or those which
ends with ‘s’ or ‘S’.
For example, if the Book.txt file contains
India is my country
All Indians are my brothers and sister’s
I respect all brothers and sisters
then the output should be: 3
28 (a) Write the outputs of the SQL queries (i) to (iv) based on the 3
relations student and sports given below:
TABLE : STUDENT
ROLL_NO SNAME AGE GENDER DOB TOTAL
A01 AKILAN S 16 M 2006-5-19 489
A02 YAZHINI 12 F 2011-1-28 456
A03 AVINESH 15 M 2007-6-20 345
A04 DEEPAK 20 M NULL 456
A06 ANU 22 O 2000-5-21 452

TABLE: SPORTS
ROLL_NO GNAME
A01 HOCKEY
A02 KABBADI
A03 HOCKEY
A06 CRICKET
(i) SELECT ROLL_NO,AGE,GNAME FROM STUDENT,SPORTS
WHERE STUDENT.ROLL_NO=SPORTS.ROLL_NO AND
GNAME LIKE ‘_R%’;
(ii) SELECT AGE,GENDER FROM STUDENT WHERE DOB IS
NOT NULL AND AGE>15;
(iii) SELECT SNAME,GENDER FROM STUDENT WHERE AGE
NOT IN(12,22);
(iv) SELECT GENDER,AVG(TOTAL) FROM STUDENT WHERE
GENDER IN(‘M’,’F’) GROUP BY GENDER;
(b) Write the command to view all tables in a database.
29 Write a function SUM_LIST(L), where L is the list of elements passed 3

7
as argument to the function. Herewith input are given
[5,15,6,1,12,10]. With the help of given inputs you are expected to
generate the following output:
The sum_list will have [5, 20, 26, 27, 39, 49]
30 A list contains following record of a employee: 3
[employee_no,employee_name,salary,mail_id]
Write the following used defined functions to perform given operations
on the stack.
(i) Push_element(a,List) – To push an object containing
employee name and mail id of employees who are having
gmail id to the stack.
(ii) Pop_element(List) – 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 employee details are:
[[‘E1’,’Akilan’,35000,’akilan_e1@gmail.com’]
[‘E2’,’Charu’,45000,’charu_e2@yahoo.com’]
[‘E3’,’Yazhini’,25000,’yazhini_e3@gmail.com’]
[‘E4’,’Muthu’,31000,’muthu_e4@rediff.com’]
The output should be:
[’Yazhini’,’yazhini_e3@gmail.com’]
[’Akilan’,’akilan_e1@gmail.com’]]
Stack Empty
OR
(a) Avinesh has a list containing integers. You need to help him
create a program with separate user defined functions to
perform the following operations based on this list.
• Traverse the content of the list and push all positive
numbers into a stack.
• Pop and display the content of the stack.
For Example:
If the sample Content of the list is as follows:
N=[2,-10,23,-34,-67,34,12,-78,-56]
Sample Output of the code should be:
12 34 23 2

8
SECTION D
31 R K International Inc. is planning to connect its Bengaluru Office 5
setup with its Head Office in Delhi. The Bengaluru Office G.R.K
International Inc is spread across an area of approx. 1 square
kilometer, consisting of 3 blocks- Human Resources, Academics and
Administration.
You have to suggest the best network related solutions for them for
issues/problems raised in question nos. (i) to (v), keeping in mind the
distances between various blocks/locations and other given
parameters.

Bengaluru Office Setup

HUMAN RESOURCES

DELHI
HEAD
OFFICE

ADMIN ACADEMICS

Shortest distances between various blocks:


Block Distance
Human Resources to Admin 110 m
Human Resources to Academics 75 m
Academics to Admin 120 m
Delhi Head Office to Bengaluru 2450 km

Number of computers:
Block Number of computers
Human Resources 170
Admin 30
Academics 90
Delhi Head Office 35
(i) Suggest the most suitable block in Bengaluru Office

9
setup, to host the server. Give a suitable reason with
your suggestions.
(ii) Suggest the most suitable media to provide secure, fast
and reliable data connectivity between Delhi Head Office
and the Bengaluru Office setup.
(iii) Suggest the cable layout among the various blocks within
the Bengaluru Office Setup for connection the Blocks.
(iv) Suggest a suitable networking device to be installed in
each of the blocks essentially required for connecting
computers inside the blocks with fast and efficient
connectivity.
(v) Suggest why should a firewall be installed at the
Bengaluru office?
32 (a) Write the output of the code given below: 2+3
a,a1=5,2
def welcome(a1,b1=2):
global a
a=6
a*=a1
b1//=a
return a,b1
print(welcome(3),welcome(2,-5),sep='&')
(b) The code given below reads records from the table named
Vehicle and displays only those records which have model
later than 2010. The structure of a record of table Vehicle is:
V_ID – integer; Name – string; Model – integer; Price –
integer
Note the following to establish connectivity between Python
and MYSQL:
• Username is root
• Password is sadhana
• The table exists in a MYSQL database named Transport.
• The details (RollNo, Name, Clas and Marks) are to be
accepted fromthe user.
Write the following missing statements to complete the code:
Statement 1 – to create the cursor object

10
Statement 2 – to execute the query that extracts records of
those vehicles whose model is greater than 2010.
Statement 3 - to read the complete result of the query into
the object named data.

import mysql.connector as mysql


def display():
con1=mysql.connect(host="localhost",user="root",
password="sadhana", database="sadhana")
_______________ #Statement 1
print("Students with marks greater than 75 are : ")
q="Select * from vehicle where model>2010"
_______________________ #Statement 2
data= _________________ #Statement 3
for rec in data:
print(rec)
OR
(a) Predict the output of the code given below:
s='Rs.10'
U=''
for i in s:
if i.upper() and i.islower():
U+=''
elif i.isdigit():
U+=i
else:
U=U
print('$'+U)
(b) The code given below accepts the increments the value of
Clas by 1 for each student. The structure of a record of table
Student is:
RollNo – integer; Name – string; Clas – integer; Marks –
integer
Note the following to establish connectivity between Python and
MYSQL:
• Username is root, Password is sadhana

11
• The table exists in a MYSQL database named school.
Write the following missing statements to complete the code:
import mysql.connector as mysql
def sql_data():
con1=mysql.connect(host="localhost",user="root",
password="sadhana")
__________________ #Statement 1
crsr.execute("use sadhana")
__________________ #Statement 2
crsr.execute(querry)
___________________ # Statement 3
print("Data updated successfully")
Statement 1 – to create the cursor object.
Statement 2 – to create the query to update the table.
Statement 3- to make the updation in the database
permanent
33 (a) What do you understand by pickling and unpickling? 5
(b) Write a Program in Python that defines and calls the
following user defined functions:
(i) ADD() – To accept and add data of an item to a CSV file
‘student.csv’ . Each record consists of stu_id, stu_name,
gender and tot_marks.
(ii) COUNTER() – To display the records of the student whose
gender is female.
OR
(a) Give any one point of difference between a csv file and a
binary file.
(b) Write a program in python that defines and calls the
following user defined functions:
(i)ADD() – To accept and add data of an item to a CSV file
student.csv. stu_id, stu_name, gender and age.
(ii) COUNTER() To display the records of the student who is
age in the range of 5 to 15.

SECTION E
34 Avinesh of class 12 is writing a program to store a character and find 4

12
their equivalents ASCII value using a dictionary. He has written the
following code. As a programmer, help him to successfully execute the
given task.
import __________ #Line 1
asc = {'A':65,'B':66,'C':67,'D':68,'E':69,'F':70,'G':71}
f1 = open("ASCII.dat",'____’) #Line 2
pickle.dump(asc,f1)
f1.close()
f2 = open("ASCII.dat",'___’) #Line 3
num = pickle.______ #Line 4
f2.close()
n=0
while n!=-1:
print("Enter only the following characters: A,B,C,D,E,F,G")
print("or enter -1 to exit")
n = input("Enter Character")
if n!= -1:
print("Equivalent ASCII value of this character is:",num[n])
else:
print("Thank You")
(i) Which module should be imported in the program?
(Statement 1)
(ii) In which mode, Avinesh should open the file to add data
into the file in Statement #2
(iii) Fill in the blank in Line 3 to read the data from a binary
file.(Statement 3)
(iv) Fill in the blank in Line 4 to read the contents of the file
“ASCII.dat(Statement 4)
35 Karan creates a table RESULT with a set of records to maintain the 1+1+2
marks secured by students in IP, BS, ACC and their total score. After
creation of the table, he has entered data of 6 students in the table.
Table :RESULT
ROLLNO ENG BS ACC ECO IP TOTAL
A10 67 90 67 56 70 350
A11 90 89 90 NULL 65 334
A12 56 23 67 45 NULL 191

13
A13 89 42 78 78 67 354
A14 56 56 67 67 53 299
A15 89 90 89 90 34 392

Table : SPORTS
ROLLNO GRADE
A11 B
A12 A+
A14 C+
A14 S
A15 A

Based on the data given above answer the following questions:


(i) Identify the most appropriate column, which can be
considered as Primary key.
(ii) Which table should he create first – Result or Sports? Justify
your answer.
(iii) Write the statements to:
(a) Write the SQL statement to add a column avg of type
float(5,2) to the table result, assuming that table
result has already been created.
(b) Increase the IP marks of the students by 2% whose
mark is less than 55.
OR (Option for part iii only)
(iii) Write the statements to:
a. Remove a column avg in the table.
b. Add a column REMARKS in the table with data type as
varchar with 50 characters

14

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy