100% found this document useful (2 votes)
5K views8 pages

Computer Sciences-XII PRACTICE-1

This document provides instructions for a practice paper for Class XII Computer Science. It has 35 questions divided into 5 sections (A-E). Section A has 18 1-mark questions. Section B has 7 2-mark questions. Section C has 5 3-mark questions. Section D has 2 4-mark questions. Section E has 3 5-mark questions. All programming questions must be answered in Python. The document provides sample questions and instructions on question format and marking.

Uploaded by

executestar
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
100% found this document useful (2 votes)
5K views8 pages

Computer Sciences-XII PRACTICE-1

This document provides instructions for a practice paper for Class XII Computer Science. It has 35 questions divided into 5 sections (A-E). Section A has 18 1-mark questions. Section B has 7 2-mark questions. Section C has 5 3-mark questions. Section D has 2 4-mark questions. Section E has 3 5-mark questions. All programming questions must be answered in Python. The document provides sample questions and instructions on question format and marking.

Uploaded by

executestar
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/ 8

PRACTICE PAPER 1

CLASS XII
COMPUTER SCIENCE (083)
Time Allowed: 3 hrs Maximum Marks: 70

General Instructions:
• This question paper contains 35 questions.
• The paper is divided into 5 Sections—A, B, C, D and E.
• Section A consists of 18 questions (1 to 18). Each question carries 1 Mark.
• Section B consists of 7 questions (19 to 25). Each question carries 2 Marks.
• Section C consists of 5 questions (26 to 30). Each question carries 3 Marks.
• Section D consists of 2 questions (31 and 32). Each question carries 4 Marks.
• Section E consists of 3 questions (33 to 35). Each question carries 5 Marks.
• All programming questions are to be answered using Python language only.

SECTION A
1. State True or False: (1)
“Comments are the statements in a script that are ignored by the Python interpreter.”
2. In a table in a MySQL database, an attribute X of datatype varchar(15) has the value "Database". The
attribute Y of datatype char(15) has the value "System". How many characters are occupied by attribute
X and attribute Y? (1)
(a) 8,6 (b) 15,6
(c) 8,15 (d) 15,8
3. Write the output of the following statement: (1)
x="AnnualMeetattheCampus"
x=x.split('a')
y=x[0]+"."+x[1]+"."+x[2]+x[3]
print(y)
(a) Annu.l Meet .t the Cmpus (b) nnu.l Meet .t the Cmpus
(c) Error (d) Annu.l Meet .t the Campus
4. Select the correct output of the code: (1)
p= (90)
print(p**2)
(a) 180 (b) 8100
(c) (90,90) (d) 8100
5. In MySQL database, a table Vehicle has 9 rows and 5 columns. If 2 more columns are added and
1 row is deleted from the table, then what will be the cardinality and degree of the said table? (1)
(a) 5,9 (b) 9,5
(c) 8,7 (d) 7,8
6. A remote control of a TV or an AC is an example of ___________ transmission. (1)
(a) Radio Wave (b) Microwave
(c) Satellite Link (d) Infrared

Practice Paper–1 1
7. Consider the statements given below and then choose the correct output from the given options: (1)
lst1= [110,115,210,215,310]
lst1.insert(3,270)
lst1.insert(2,980)
print(lst1[-5])
(a) 980 (b) 110
(c) 2 (d) 3
8. Write the output of the given Python code – (1)
d={"emp":"Yuvan","Salary":95000}
d["Salary"] = 105000
d["city"] = "Pune"
print(d.items())
(a) dict_items([('emp', 'Yuvan'), ('Salary', 105000), ('city', 'Pune')])
(b) d_items([('emp', 'Yuvan'), ('Salary', 105000), ('city', 'Pune')])
(c) dict_items({('emp', 'Yuvan'), ('Salary', 105000), ('city', 'Pune')})
(d) dict_items(['emp', 'Yuvan', 'Salary', 105000, 'city', 'Pune'])
9. What will be the output of the following code? (1)
msg="**BUSINESSCONFERENCE Held in 2024**"
print(msg[::-2])
(a) **4202 ni dlehH ECNEREFNOCSSENISUB**
(b) *40 ide CEENCSNSB*
(c) *BSNSCNEEC edi o4*
(d) *UNSNRC e i 24
10. What possible output(s) will be obtained when the following code is executed? (1)
import random
elements=[180,90,77,65,33,12,54,4,219]
beg=random.randint(1,4)
final=random.randint(beg,5)
for z in range(beg,final+1):
print(elements[z],"@")
(a) 90 @ (b) 90 @
77 @ 77 @
65 @ 54 @
33 @ 4 @
(c) 180 @ (d) 90 @
12 @ 4 @
11. Fill in the blank: (1)
________ protocol is used to transfer files from server system to requesting node for information sharing.
(a) PPP (b) FTP
(c) TCP (d) SMTP
12. Consider the code given below and choose the correct option from the following: (1)
def display_Min_value(m, n):
if m > n:
print(n, "is minimum")

2 Practice Paper–1
elif m == n:
print(m, "is equal to", n)
else:
print(m, "is minimum")
display_Min_value(250, 400)
(a) 250 (b) 400
(c) 250 is minimum (d) Error
13. Which statement allows us to throw an exception at any time in a program? (1)
(a) except (b) try
(c) throw (d) raise
14. Mr. Narang, DBA of GreenApple Pvt. Ltd., has created a table to manage the records of the company’s clients
but he forgot to add a column Contact_No in the table. Help him write the SQL statement to add the new
column Contact_No of integer type and size 10 bytes in the table ‘Client’. (1)
15. Write any 2 advantages of Bus Topology in a network. (1)
16. If f is the file pointer of a text file "Simple.txt", then f.seek(20) moves the file pointer to what
location in the file? (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): Tuples are immutable in nature.
Reason(R): Immutability of a data type in Python states that we can make changes in it. (1)
18. Assertion(A): In a function, return statement returns the value of an expression following the return
keyword.
Reason(R): The default value None is returned in the case of absence of the return statement. (1)
SECTION B
19. (i) Expand the following terms: (1+1=2)
SMTP, URL
(ii) Define the following terms:
Website, Web Page
OR
(i) Identify the following: (1+1=2)
(a) I am a wireless device that offers internet connectivity to mobile phones and other devices.
(b) I am a networking device used to connect multiple computers. I broadcast the data to all the nodes
in a network.
(ii) Differentiate between LAN and MAN.
20. Observe the following code carefully and rewrite it after removing all syntax and logical errors. Underline
all the corrections made. (1+1=2)
(i) Def Prod(x=5,y)
return x*y
print ("The Product is =" Prod(7, 1)
(ii) def top(a,b):
print(a + b)
top(5)

Practice Paper–1 3
21. Write a function STR_PALIN(Str) that takes string as an argument and returns if a string is a palindrome
or not (A string is called palindrome if it reads the same backwards as forward). (2)
For example, if the string is
Str = Naman
Then output should be:
The given string Naman is a palindrome.
OR
Write a function REPLACE_VOWEL(St) that takes string as an argument and returns a string in which all
vowels are replaced with ‘*’.
For example, if the string is
St= Message your token number
Then output should be:
St = M*ss*g* y**r t*k*n n*mb*r
22. Predict the output of the following code. (2)
st1= "WeLcOME"
st2="GUeSTs"
st3=""
for j in range(0, len(st2)+1):
if st1[j]>="A" and st1[j]<="M":
st3=st3+st1[j]
elif st1[j]>="N" and st1[j]<="Z":
st3=st3+st2[j]
else:
st3=st3+"*"
print(st3)
23. Write a Python statement for each of the following tasks using BUILT-IN functions/methods only.
(1+1=2)
(i) To find the minimum value from a list named ‘Numbers’.
(ii) To find and print the length of words from the list.
24. Create an SQL table named ‘Products’ with the following columns, each having specific constraints: (2)
Product_ID of integer type, serving as the primary key.
Product_Name of varchar type with a maximum length of 50 characters and should not be null.
Category of varchar type with a maximum length of 30 characters and should not be null.
Price of decimal type, ensuring it is greater than zero.
Stock_Quantity of integer type, if no value is given, then default value should be 1.
OR
Imagine you are working with a database for a library system and there is a table named ‘Books’ with the
following columns:
Book_ID of integer type, serving as the primary key.
Title of varchar type with a maximum length of 100 characters and should not be null.
Author of varchar type with a maximum length of 50 characters and should not be null.
Publication_Year of integer type representing the year the book was published.

4 Practice Paper–1
ISBN of varchar type with a fixed length of 13 characters, serving as a unique identifier for each book.
Due to an update in the ISBN standards, there is a need to modify the structure of the ‘Books’ table. Write
an SQL statement to change the data type of the ISBN column from varchar to char(13), ensuring that the
other constraints on the table remain valid.
25. Predict the output of the following code: (2)
value=210
def calculate():
global value
value=450
print(value, end='')
calculate()
print(value)
SECTION C
26. Predict the output of the Python code given below: (3)
vege_list1 =['Potato','Onion','Tomato']
vege_list2 =vege_list1
vege_list3 =vege_list1[:]
vege_list2[0]='Ladyfinger'
vege_list3[1]='Brinjal'
sum=0
for ls in(vege_list1, vege_list2,vege_list3):
if ls[0]=='Ladyfinger':
sum +=1
if ls[1]=='Brinjal':
sum +=20
print("The sum is ",sum)
27. Consider the table HOSTEL given below and write the output of the SQL queries that follow. (3)
Table: HOSTEL
H_NO CATEGORY WARDEN_NAME CHARGES FACILITY STU_NAME
GH-1 AC Ms. Sangeeta 50000 Food Neha Kapoor
BH-2 NON-AC Mr. Satinder 40000 Food Vikas Jain
GH-2 NON-AC Ms. Sakshi 42000 Laundry Manisha Gupta
BH-3 AC Mr. Rohan 52000 Food Amit Jindal
GH-5 AC Ms. Vineeta 50000 Laundry Shreya Sharma
(i) Select category, avg(charges) from hostel group by category;
(ii) Select stu_name, h_no, charges from hostel where stu_name like '%i%' order
by charges desc;
(iii) Select h_no, facility, Warden_name from hostel where charges between 40000
and 45000;
28. Write a function read_text() in Python to read a text file "data.txt" line by line and display the same
on the screen. (3)
OR
Write a function three_char_words() in Python to read lines from the text file "document.txt" and
display all those words, which has three characters in it.

Practice Paper–1 5
29. Consider the table Candidate given below: (3)
Table: CANDIDATE
Candidate_No C_Name Department Stipend Gender
101 Manoj Finance 32000 M
303 Vinay HR 42500 M
401 Mansi Finance 31500 F
603 Kamal IT 32150 M
604 Veena HR 42000 F
631 Sujata Finance 39500 F
Based on the given table, write SQL queries for the following—
(i) Increase the stipend of all the candidates by 10%.
(ii) Delete records of female candidates.
(iii) Display all the records of candidate whose stipend is more than 44000.
30. Each node of a STACK contains the following information: (3)
PNR number of a passenger and Name of a passenger.
[PNR_NO, NAME]
Write the following user defined functions in Python to perform the specified operations on the stack named
Passenger.
(i) PUSH() - To push a node into the stack.
(ii) POP()- To remove a node from the stack.
SECTION D
31. Consider the tables SPORTS and CLUB given below: (1x4=4)
Table: SPORTS
S_NO S_NAME FEES NO_OF_DAYS TRAINING_TYPE
1120 Cricket 5500 5 Group
1326 Badminton 4500 3 Personal
1786 Swimming 5000 5 Personal
1909 Tennis 3500 2 Group
1005 Basket Ball 3800 4 Group
Table: CLUB
S_NO CLUB_COACH LOCATION GENDER
1005 Mr. Sumit Sharma Pitampura Male
1786 Mr. Rohit Jain Shalimar Bagh Male
1909 Ms. Sandhya Kumari Ashok Vihar Female
1120 Mr. Kapil Yadav Vikas Puri Male
1326 Ms. Rohini Vijay Nagar Female
Write SQL queries for the following—
(i) Display sports name and coach name from table SPORTS and CLUB.
(ii) Display the number of sports on the basis of type of training.
(iii) Display the average of sports fees whose sports name contains letter ‘t’.
(iv) Display sports name, fees, coach name and location of male coach from the tables SPORTS and CLUB.

6 Practice Paper–1
32. Samiksha has a CSV file "Scores.csv" which has StuName, StuClass and StuScores separated by comma.
She is writing a Python program to copy only the students’ name and class to another CSV file "Records.
csv". She has written the following code. As a programmer, help her to successfully perform the given
task. (4)
import csv
file = open('Records.csv', _____(a)_____, newline="")
writer = csv.writer(file)
with open('Scores.csv') as csvfile:
data = csv. _____(b)_____(csvfile)
for row in data:
writer.writerow([ _____(c)_____, _____(d)_____])
file.close()
(a) In which mode should Samiksha open the file to make a new file?
(b) Fill in the blank to read the data from a CSV file.
(c) Fill in the blank to write student name into Scores.csv.
(d) Fill in the blank to write student class into Scores.csv.
SECTION E
33. Infra Ltd. has four blocks of building as shown below. Computers in each block are networked but blocks are
not networked. The company has now decided to connect the blocks also. (5)

Block A INFRA LTD Block D

Block B Block C

The distance between various blocks:


Block C TO Block A 50m
Block A TO Block B 60m
Block B TO Block D 25m
Block D TO Block C 170m
Block C TO Block B 125m
Block A TO Block D 90m
Number of computers in each block:
Block A 150
Block B 15
Block C 15
Block D 25
(a) Suggest the most appropriate topology for the connections between the blocks.
(b) The company wants internet accessibility in all the blocks. Suggest the most suitable and cost-effective
technology for that.
(c) Which device will you suggest for connecting all the computers in each block?
(d) The company is planning to link its head office situated in New Delhi with the offices in hilly areas.
Suggest a way to connect it economically.
(e) Suggest the most appropriate location of the server to get the best connectivity in the network.

Practice Paper–1 7
34. (i) Observe the following code and answer the questions that follow: (2+3=5)
F = open("Myfile","a")
___________ #Blank 1
F.close()
(a) What type (Text/Binary) of file is Myfile?
(b) Fill in the Blank 1 with statement to write “Examination” in the file “Myfile”.
(ii) The given code is written to update a record in a file opened with the following code: -
import pickle
f1 = open("Emp.dat", 'rb')
try:
while True:
_____ = f1.tell() #Line 1:store file-pointer position before
reading the record
emp = pickle.load(f1))
if emp['Score'] in [89, 83, 96]:
emp[ 'Marks'] += 3 #changes made in the record
f1._____ (_____) # Line 2: place the file-pointer at the exact location
of the record
____________ # Line 3: write the updated record on the exact location
except:
:
:

35. (i) Differentiate between Having Clause and Where Clause in RDBMS. (1+4=5)
(ii) Complete the following database connectivity program by writing missing statements and performing
the given query.
import ___________ as pt #Statement 1
con=pt.____________ (host="localhost", user="root", passwd="123",
database="drugs") #Statement 2
mycursor=con.cursor()
mycursor.execute(___________) #Statement 3
data=mycursor.______________ #Statement 4
for i in data:
print(i)
con.close( )
(a) Complete the #Statement 1 by writing the name of library needed to import for database connectivity.
(b) Complete the #Statement 2 by writing the name of the function that is required to create the connection
between Python and MySQL.
(c) Complete the #Statement 3 by writing the query to display those drugs records having price range
between 50 to 100 from table Drug.
(d) Complete the #Statement 4 to retrieve all records from the result set.
OR
(i) Which clause is used to eliminate the redundant records from the table? (1+4=5)
(ii) Shanti Memorial Hospital is managing the patients’ data in "Hospital" database. Write a Python code
that connects to a database school and retrieves Drug and retrieves all records and displays total
number of patients.

8 Practice Paper–1

You might also like