XII CS PractisePaper 1
XII CS PractisePaper 1
XII CS PractisePaper 1
BLUE PRINT
Topic / Unit VSA (1 mark) SAI (2 marks) SA II (3 marks) LA (4 marks) Total
Programming and 2(2) 9(18) 2(6) 1(4) 14(30)
Computational Thinking
Computer Networks 4(4) 2(4) 1(3) 1(4) 8(15)
Data Management 7(7) 2(4) - 1(4) 10(15)
Society, Law and Ethics 2(2) 4(8) - - 6(10)
Total 38(70)
Difficulty Level :
Easy : 15%
Average : 70%
Difficult : 15%
HOTS-based Questions : 20%
Half Yearly Examination
Marking Scheme
CLASS XII COMPUTER SCIENCE (083)
TIME: 3 hrs M.M: 70
1. (a) Differentiate between mutable and immutable objects in Python language with example. (2)
Ans. Every variable in Python holds an instance of an object. There are two types of objects in Python,
i.e., Mutable and Immutable objects. Whenever an object is instantiated, it is assigned a unique
object id. The type of the object is defined at the runtime and it can’t be changed afterwards.
However, its state can be changed if it is a mutable object.
For example, int, float, bool, string, unicode, tuple are immutable objects in Python. In simple words, an
immutable object can’t be changed after it is created. Lists, dictionaries and sets are mutable types.
(b) Identify and write the name of the module to which the following functions belong: (1)
(i) ceil() (ii) findall()
Ans. (i) ceil() – math module (ii) findall() – re module
(c) Observe the following Python code very carefully and rewrite it after removing all syntactical errors
with each correction underlined. (2)
DEF execmain():
x = input("Enter a number:")
if (abs(x)= x):
print"You entered a positive number"
else:
x=*-1
print"Number made positive:"x
execmain()
Ans. Corrected code:
def execmain():
x= input("Enter a number:")
if(abs(x)== x):
print("You entered a positive number")
else:
x *= -1
print("Number made positive:",x)
execmain()
(d) Find the output of the following: (2)
L1 = [100,900,300,400,500]
START = 1
SUM = 0
for C in range(START,4):
SUM = SUM + L1[C]
print(C, ":", SUM)
SUM = SUM + L1[0]*10
print(SUM)
Ans. Output is:
1 : 900
1900
2 : 2200
3200
3 : 3600
4600
(e) Write the output of the following Python program code: (3)
def ChangeList():
L=[]
L1=[]
L2=[]
for i in range(1,10):
L.append(i)
for i in range(10,1,–2):
L1.append(i)
for i in range(len(L1)):
L2.append(L1[i]+L[i])
L2.append(len(L)-len(L1))
print(L2)
ChangeList()
Ans. Output is:
[11,10,9,8,7,4]
(f) Study the following program and select the possible output(s) from the options (i) to (iv) following it.
Also, write the maximum and the minimum values that can be assigned to the variable Y. (2)
import random
X= random.random()
Y= random.randint(0,4)
print(int(X),":",Y+int(X))
(i) 0 : 0 (ii) 1 : 6
(iii) 2 : 4 (iv) 0 : 3
Ans. (i) and (iv) are the possible outputs. Minimum value that can be assigned is – Y = 0. Maximum value
that can be assigned is – Y = 3
2. (a) Explain operator overloading with the help of an example. (2)
Ans. Operator overloading is a feature in Python that allows the same operator to have a different meaning
according to the context. It signifies giving extended meaning beyond the predefined operational
meaning. For example, operator + is used to add two integers as well as join two strings and merge
two lists.
For example,
>>print(44 + 2)
46
# concatenate two strings
print("Python"+"Programming")
PythonProgramming
# Product of two numbers
print(5 * 5)
25
# Repeat the String
print("Hello"*3)
HelloHelloHello
(b) Find the output of following: (2)
colors = ["violet", "indigo", "blue", "green", "yellow", "orange", "red"]
del color[4]
colors.remove("blue")
colors.pop(3)
print(colors)
Ans. Output is:
['violet', 'indigo', 'green', 'red']
(c) Find the output of the following: (2)
str = "Pythonforbeginners is easytolearn"
str2 = "easy"
print("The first occurrence of str2 is at : ", end="")
print(str.find( str2, 4))
print("The last occurrence of str2 is at : ", end="")
print(str.rfind( str2, 4))
Ans. Output is:
The first occurrence of str2 is at : 22
The last occurrence of str2 is at : 22
3. (a) Write the definition of a function Reverse(X) in Python to display the elements in reverse order such
that each displayed element is twice of the original element (element *2) of the List X in the following
manner: (2)
Example:
If List X contains 7 integers as follows:
X[0] X[1] X[2] X[3] X[4] X[5] X[6]
4 8 7 5 6 2 10
After executing the function, the array content should be displayed as follows:
If List
Ans.
20 4 12 10 14 16 8
def Reverse(X):
for i in range(len(X)-1,-1,-1):
print(X[i]*2)
(b) Consider the following unsorted list: 95 79 19 43 52 3. Write the passes of bubble sort for sorting
the list in ascending order till the 3rd iteration. (3)
Ans. [79, 19, 43, 52, 3, 95]
[19, 43, 52, 3, 79, 95]
[19, 43, 3, 52, 79, 95]
(c) Write a user-defined function to generate odd numbers between a and b (including b). (3)
Note: a and b are received as an argument by the function.
Ans. def generateodd(a,b):
for i in range(a, b+1):
if(i%2 != 0):
print(i)
(d) Observe the following code and answer the questions that follow: (1)
File = open("Mydata","a") _____________________ #Blank1
File.close()
(i) What type (Text/Binary) of file is Mydata?
(ii) Fill in Blank 1 with a statement to write “ABC” in the file “Mydata”.
Ans. (i) Text File
(ii) File.write("ABC")
4. (a) Write any one advantage and one disadvantage of Coaxial cable. (1)
Ans. Advantages:
• It is less susceptible to noise or interference (EMI or RFI) as compared to twisted pair cable.
• It supports high bandwidth signal transmission as compared to twisted pair.
• It is easy to wire and easy to expand due to its flexibility.
Disadvantages:
• It is bulky.
• It is expensive to install for longer distances due to its thickness and stiffness.
(b) Riana Medicos Centre has set up its new centre in Dubai. It has four buildings as shown in the diagram
given below: (4)
Accounts
Lab
Unit
To select tuples with some esalary, Arun has written the following erroneous SQL statement:
SELECT eid, esalary FROM empsalary WHERE esalary = something;
Write the correct SQL statement.
Ans. The correct SQL statement is:
SELECT eid, esalary FROM empsalary WHERE esalary is NOT NULL;.
(d) Table COACHING is shown below. Write commands in SQL for (i) to (iii) and output for (iv) and (v)
(4)
ID NAME AGE CITY FEE PHONE
P1 SAMEER 34 DELHI 45000 9811076656
P2 ARYAN 35 MUMBAI 54000 9911343989
P4 RAM 34 CHENNAI 45000 9810593578
P6 PREMLATA 36 BHOPAL 60000 9910139987
P7 SHIKHA 36 INDORE 34000 9912139456
P8 RADHA 33 DELHI 23000 8110668888
(i) Write a query to display name in descending order whose age is more than 23.
Ans. select name from coaching where age>23 order by name desc;
(ii) Write a query to find the average fee grouped by age from customer table.
Ans. select avg(fee) from coaching group by age;
(iii) Write query details from coaching table where fee is between 30000 and 40000.
Ans. Select * from coaching table where fee is between 30000 and 40000;
(iv) Select sum(Fee) from coaching where city like “%O% ;
Ans. 94000
(v) Select name, city from coaching group by age having count(age)>2;
Ans. Empty set
7. (a) What are the proper methods and steps for the disposal of used electronic items? (1)
Ans. Explanation about any methods like:
• Landfilling • Acid Bath
• Incineration • Recycling of e-waste
• Reuse of electronic devices
(b) When did IT Act come into force? (1)
Ans. 17th October, 2000.
(c) Explain the gender and disability issues while using computers in the classroom. (1)
Ans. It has been seen in many studies that in many countries computer use in schools is dominated by men.
Female teachers have less regard for their skills and knowledge than their male colleagues.
Females know less about information technology, enjoy using the computer less than male students,
and perceive more problems with software.
(d) How can we recycle e-waste safely? (2)
Ans. (i) Use a certified e-waste recycler.
(ii) Visit civic institutions. Check with your local government, schools and universities for additional
responsible recycling options.
(iii) Explore retail options.
(iv) Donate your electronics.
(e) Name some threats to computer security. (1)
Ans. • Snooping • Identity theft • Phishing
• Virus and Trojans • Child pornography, etc.
(f) What is meant by the term Cyber Forensics? (2)
Ans. Cyber forensics is an electronic discovery technique used to determine and reveal technical criminal
evidence. It often involves electronic data storage extraction for legal purposes. Although still in its
infancy, cyber forensics is gaining traction as a viable way of interpreting evidence.
Cyber forensics is also known as computer forensics.
(g) Write any two categories of cyber crime. (1)
Ans. Cyber crime encompasses a wide range of activities, but these can generally be broken into two
categories:
• Crimes that target computer networks or devices: Such types of crimes include viruses and
denial-of-service (DoS) attacks.
• Crimes that use computer networks to advance other criminal activities: These types of crimes
include cyberstalking, phishing and fraud or identity theft.
(h) How does phishing happen? (1)
Ans. Phishing is a fraudulent attempt to obtain sensitive information such as usernames, passwords, and
credit card details (and money), often for malicious reasons, by disguising as a trustworthy entity in
an electronic communication. Phishing is typically carried out by email spoofing or instant messaging,
and it often directs users to enter personal information at a fake website, the look and feel of which
is identical to the legitimate one and the only difference is the URL of the website in question.
(i) Define and name some open source software. (1)
Ans. GPl, Apache, Creative Commons, Mozilla Firefox, Open Office.org, etc.
(j) What are Intellectual Property Rights (IPR)? (1)
Ans. IPR is a general term covering patents, copyright, trademark, industrial designs, geographical
indications, layout design of integrated circuits, undisclosed information (trade secrets) and new
plant varieties.