Professional Documents
Culture Documents
CBSE Sample Papers For Class 11 Computer Science Set 3 With Solutions
CBSE Sample Papers For Class 11 Computer Science Set 3 With Solutions
CBSE Sample Papers For Class 11 Computer Science Set 3 With Solutions
ADVERTISEMENT
General Instructions:
Section A
[Each question carries 1 mark]
ADVERTISEMENT
Question 1.
_____ is known as the brain of the computer. [1]
(A) CU
(B) ALU
(C) CPU
(D) Memory unit
Answer:
(C) CPU
Explanation:
The CPU is considered the brain of a computer because it performs the majority of the
processing tasks, coordinating and executing instructions to carry out calculations and control
the computer’s operations.
Question 2.
The expression of a NAND gate is
(A) A.B.
(B) A’B+AB’
(C) (A.B)
(D) (A + B)
Answer:
(C) (A.B)
Explanation:
NAND Gate is an inverter of AND gate. It gives a High Input if any of the input is low. Its
symbol is AND Gate with a small circle at the output implying inversion.
Question 3.
In Binary, (F)16 is represented by [1]
(A) (1101)2
(B) (1111)2
(C) (1110)2
(D) (0111)2
Answer:
(B) (1111)2
Explanation:
Each hexadecimal digit can be converted to binary by replacing it with its corresponding
four-bit binary representation. In ‘ this case, the digit F is replaced by 1111, which represents
the value 15 in decimal and is equivalent to F in hexadecimal.
Question 4.
State TRUE or FALSE. [1]
Python can’t be used for game development.
Answer:
False
Explanation:
Python is used in game development because it’s an incredibly versatile and powerful
programming language.
Question 5.
Which of the following statements about Python variables is true?
(A) They must be declared with a specific data type.
(B) They are case-sensitive.
(C) They cannot be reassigned once a value is assigned to them.
(D) They can only store numeric values.
Answer:
(B) They are case-sensitive.
Explanation:
In Python, variables are case-sensitive, which means that “myVar” and “myvar” would be
considered as two separate variables.
Python uses dynamic typing, so variables do not need to be declared with a specific data type
(option A is incorrect). Python variables can be reassigned with new values throughout the
program (option C is incorrect). Python variables can store various types of data, including
numeric values, strings, lists, and more (option D is incorrect).
Question 6.
What is the value of y after evaluating the following expressions?
x=5
y = x+++++x – x—–x
(A) 0
(B) 5
(C) 7
(D) 8
Answer:
(A) 0
Explanation:
Expression is evaluated in the order: y = (x++) + (++x) – (x–) – (–x).This becomes: x++ = 5
and then updates the value of x to 6, as it is a postfix operator. Now prefix operator, ++x
increments the value of x from 6 to 7 and then uses it. So till now, y = 5 + 7 = 12 and x = 7.
Now, further moving right, x– first uses the current value of x and then decrements it by 1 as
it is a postfix operator. So y = 12 – 7 = 5 and then x = 6. Then –x decrements the value of x
by 1 and then uses it, so y = 5 – 5 = 0 and x = 5.
Question 7.
State TRUE or FALSE.
Banks and similar institutions have been the worst affected sectors due to technological
advancements. [1]
Answer:
False
Explanation:
(1) The biggest revolution that comes came in banks is Digitization. Due to this, the banking
process is faster than before and more reliable. Maintenance and retrieval of documents and
records have become much faster and easier. (2) Computerized banking also improves the
core banking system.
Question 8.
What will be the output of the following? [1]
>> print(bool(0))
(A) True
(B) False
(C) 0
(D) 1
Answer:
(B) False
Explanation:
The bool() ‘ function in Python converts an integer to a boolean value by considering the
integer zero as ‘False’ and any non-zero integer as ‘ True ‘.
Question 9.
What gets printed with the following code ? [1]
x = True
y = False
z = False
if x or y and z :
print("yes")
else:
print("no")
(A) False
(B) True
(C) yes
(D) no
Answer:
(C) yes
Explanation:
x OR y AND z
= True OR False AND False
= True OR False
= True
Question 10.
What gets printed with the following code ?
for i in range(2):
print (i, end = ",")
for i in range(4, 6)
print (i, end=",")
(A) 0, 1, 4, 5
(B) 0, 1, 2, 4, 5, 6
(C) 2, 4, 6
(D) 2, 4, 5, 6
Answer:
(A) 0, 1, 4, 5
Explanation:
The range () function generates a sequence of numbers, starting from 0 by default, and
increments by 1 (also by default), and stops before a specified number. So the first loop prints
0 and 1. Then second for loop prints i starting from 4, and then 5.
Question 11.
What will be the output of the below Python code?
str123="12/7"
print("str123")
(A) 12/7
(B) 1.7
(C) 1
(D) str123
Answer:
(D) str123
Explanation:
Since in the print statement, s t r 12 3 is written inside double quotes so it will simply print
str123 directly.
Question 12.
What is the value of ‘new_list’?
my_list = [1, 2, 3, 4, 5]
new_list = my_list[1 : 4]
(A) [1, 2, 3]
(B) [2, 3, 4]
(C) [1, 4]
(D) [1, 2, 3, 4]
Answer:
(B) [2, 3, 4]
Explanation:
The expression my_list [1:4] performs list slicing, which selects elements from index 1
(inclusive) to index 4 (exclusive).
In Python, indexing starts at 0, so the elements at index 1, 2, and 3 are 2, 3, and 4,
respectively.
Question 13.
What is the output of the code?
my_tuple = (1, 2, 3, 4, 5)
my_tuple[0] = 10
(A) TypeError: ‘tuple’ object does not support item assignment
(B) [10,2,3,4,5]
(C) (10,2,3,4,5)
(D) (1,2,3,4,5)
Answer:
(A) TypeError: ‘tuple’ object does not support item assignment
Explanation:
Tuples in Python are immutable, which means their elements cannot be modified once they
are assigned. The line my_tuple[0] = 10 attempts to modify the element at index 0, assigning
it the value 10.
This operation raises a TypeError: ‘tuple’ object does not support item assignment.
Question 14.
Which of the following is the correct form of using dict () ?
(A) dict([(‘a’, 45),(‘b’,76)])
(B) dict({‘a’: 45,’b’:76})
(C) None of these
(D) All of these
Answer:
(D) All of these
Explanation:
The contents of a diet can be written as a series of key:value pairs within braces { }, e.g. dict
= { key1: value1, key2:value2, ….. }. It can also be passed as a list of pairs of key and value.
So option A and B both are correct.
Question 15.
The data taken from a digital footprint can be used for
(A) Hacking
(B) Only for feedback
(C) Showing relevant ads
(D) All of these
Answer:
(D) All of these
Explanation:
The data taken from a digital footprint can be used for various purposes. It can be exploited
for hacking, used for providing feedback to improve products or services, and utilized for
displaying relevant ads. Therefore, all of these options are possible uses of the data obtained
from a digital footprint.
Question 16.
The trademark product is denoted by symbols.
(A) ® or™
(B) ©
(C) ℗
(D) None of these
Answer:
(A) ® or™
Explanation:
Trademark includes any visual symbol, word, name, design, slogan, label etc., that
distinguishes the brand or commercial enterprise, from other brands or commercial
enterprises.
Q17 and 18 are ASSERTION (A) AND REASONING (R) based questions. Mark the correct
choice as
(A) Both A and R are true and R is the correct explanation of A
(B) Both A and R are true but R is not the correct explanation of A
(C) A is true but R is false
(D) A is false but R is true
Question 17.
Assertion: The digital footprint is created automatically when you work on internet and
provide data in any
form. [1]
Reasoning: The active digital footprint is created unintentionally without the user’s consent.
Answer:
(C) A is true but R is false
Explanation:
Assertion (A) states that the digital footprint is created automatically when you work ‘ on the
Internet and provide data in any form, which is true.
Reason (R) is false as users sometimes actively engage in online activities, knowingly
providing information and participating in various platforms, thereby creating their digital
footprint with their consent. Therefore, the correct choice is (C) A is true but R is false.
Question 18.
Assertion: Indentation refers to adding the relevant number of tabs and spaces at the
beginning of lines of code
to indicate a block of code. [1]
Reasoning: Indentation is very important to make the code readable, without indentation you
find it hard to read or debug a program.
Answer:
(A) Both A and R are true and R is the correct explanation of A
Explanation:
Indentation refers to adding tabs and spaces at the beginning of lines of code to indicate a
block of code. It is important for code readability and making it easier to understand and
debug a program. Without proper indentation, code can be difficult to read and debug.
Therefore, both the assertion and reasoning are true, and the reasoning explains the
importance of indentation.
Section B
[Each question carries 2 marks]
Question 19.
Draw the equivalent logic circuit diagram for the Boolean expression (A’+B).C’ [2]
OR
(ii) The truth table for all possible combination of values of X, Y are.
X Y XY X + XY
0 0 0 0
0 1 0 0
1 0 0 1
1 1 1 1
Comparing the values of columns X and X + XY the expression is verified.
Question 20.
Convert (2267)8 into decimal. [2]
Answer:
2267 = 2*83 + 2*82 + 6*81 + 7*80
= 2 * 512 + 2 * 64 + 6 * 8 + 7 * 1
= 1024 + 128 + 48 + 7
= 1207
Question 21.
What will be the output of the following statements when inputs are [2]
a, b, c=30, 20, 30
(i) print (a<b<=c)
(ii) print(a>b<=c)
OR
x=5
while(x<15)
print (x**2)
x+=3
Answer:
(i) False
(ii) True
Explanation:
(i) ab evaluates to True, so it checks further and b<=c is also True, so overall the result
evaluates to True.
OR
25
64
121
196
Question 22.
Consider the following string Subject: [2] Subject = “Computer Science” What will be the
output of:
(a) print (Subject [: 3 :2 ])
(b) print(Subject[-9:-1])
(c) print (Subject [ 10 : : -2] )
(d) print(Subject*2)
OR
Explanation:
slicing works as Subject [start_ index: stop_index: gap in between].
Stop index is not included, whereas start index is included.
(a) Extracts the characters between 0th (incl.) and 3rd (excl.) index, at intervals of 2, i.e.,
alternate index.
(b) Extracts substring from 9th index from right (other end) and till the 1st index on right.
(c) Extracts from the 10th index till the last, at alternate indices and in reverse order, i.e., from
the last character on right till the character at the 10th index.
(d) Appends the string once again at the last of the current string PH
OR
Explanation:
(a) list() function splits each ’ character into list by default, (b) listl stores elements, but is
then cleared using clear ()
Question 23.
Predict the output of the following Python code. [2]
num1=dict([('a',"hello"), ('b',"welcome")])
print('num1 = ',num1)
num2=dict([('a',"hello"), ('b',"welcome"), ('c',"good bye")])
print('num2 =' ,num2)
OR
Write the output of the following:
>>> a="python"
>>> b=list (a)
>>> b*2
>>> b+b
>>> a+a
Answer:
Lastly, the third part focuses on num3, which is constructed by combining two lists (‘x’, ‘y’,
‘z’) and (23, 45, 67) using the zip() function. The resulting pairs are transformed into
dictionaries, and subsequently, these dictionaries are merged into a single dictionary named
num3 utilizing the diet () constructor.
OR
[‘p’, 'y', ‘t’, ‘h’, ‘o’ ‘n’, p'' ‘y’, ‘t’ ‘h’, ‘o’ ‘n’]
['p', ‘y’, 't’, ‘o’, ‘t’, ‘h’, ‘o’, ‘n’]
‘pythonpython
Question 24.
What are the different ways to dispose of e-waste? [2]
Answer:
Ways to dispose off e-waste:
Question 25.
What are the gender issues and disability issues while teaching or using computers? [2]
Answer:
Gender Issues
1. Preconceived notions — Notions like “boys are better at technical and girls are
good at humanities.
2. Lack of motivation
3. Lack of role models
4. Lack of encouragement in class
5. Not a girl friendly work culture
Disability Issues:
Section C
[Each question carries 3 marks]
Question 26.
What is the need for secondary memory? [3]
Answer:
1. Primary memory has limited storage capacity and is either volatile (RAM) or
read-only (ROM). Thus, a computer system needs auxiliary or secondary
memory to permanently store the data or instructions for future use.
2. Secondary storage devices like CDs and flash drives can transfer the data from
one device to another.
3. Storage Capacity: Secondary memory provides a significantly larger storage
capacity compared to primary memory (RAM).
Question 27.
What does ‘immutable’ mean? Which data types in Python are immutable. [3]
Answer:
In Python, ‘immutable’ refers to the property of an object that cannot be modified after it is
created. Once an immutable object is assigned a value, its content cannot be changed. Instead,
if a modification is needed, a new object is created with the updated value.
It’s important to note that although the objects of these data types are immutable, variables
that reference these objects can be reassigned to new values. However, the original object
itself remains unchanged.
Python has the following immutable datatypes: Numbers (int, float, complex), String, and
Tuple.
Question 28.
Write a program that reads a string and then prints a new string that capitalizes every second
letter in the original string, e.g., computer becomes cOmPuTeR. [3]
OR
(a)
(a) [1, 2, 3]
(b) [6, 7, 8, 9, 10]
(c) [2, 4, 6, 8, 10)
Explanation:
(a) deleted the elements at and after 3rd index,
(b) deleted the elements till the 5th index (excluding it),
(c) deleted alternate elements from 0th index till last index (including both), i.e., at a gap of 2.
Question 29.
Write the output of the following code. [3]
t=tuple()
t = t + ( 'Python',)
print(t)
print (len (t))
t1= (10,20,30)
print(len(t1))
Answer:
(‘Python’,)
1
3
Explanation: In line2,Theempty tuple tis reassigned with a new tuple that concatenates the
original tuple with the element ‘Python’. The comma after ‘Python’ ensures that it is treated
as a tuple element. So, the updated tuple becomes (‘Python’,).
The len() function in line 4 calculates the length of the tuple t, which is 1 since it contains
only one element.
In line 5, a new tuple tl is created with three elements (10,20,30), and thus its length is 3.
Question 30.
Explain the importance of intellectual property rights (IPR) in computer science. Provide two
examples of the intellectual property in the field. [3]
Answer:
Intellectual property rights (IPR) are crucial in computer science for several reasons. They
protect the rights of creators and encourage innovation. Two examples of intellectual
property in computer science are
Section D
[Each question carries 4 marks]
Question 31.
Write 2 advantages and 2 disadvantages of Digital Footprints. [4]
Answer:
Advantages of Digital Footprints:
Question 32.
Consider the code given below to compute energy through mass m multiplied by the speed of
light (c=3*108). Fill in the gaps as given in the statements. [4]
Section E
[Each question carries 5 marks]
Question 33.
Write an algorithm to find: [5]
(i) Factorial of a number
(ii) Print Fibonacci series upto n. Fibonacci number is the sum of previous 2 numbers in the
series. Series is: 0, 1, 1, 2, 3, 5,…
OR
(a)
num1 = 4
num2 = num1 + 1
num1 = 2
print (num1, num2)
(b)
num1, num2 = 2, 6
num1, num2 = num2, num1 + 2
print (num1, num2)
(c)
num1, num2 = 2, 3
num3, num2 = num1, num3 + 1
print (num1, num2 , num3) [3]
(ii) Draw a flowchart to print numbers from n to 1. [3]
Where n is input by user. [2]
Answer:
(i)
Step 1: Start
Step 2: Read a number n
Step 3: Initialize variables:
i=1, fact=1
Step 4: if i<= n go to step 5 otherwise go to step 6
Step 5: Calculate
fact =fact *i
(i=i+1) and go to step 4
Step 6: Print fact
Step 7: Stop
(ii)
Step 1: Start
Step 2: Declare variable n1, n2, sum, n, i
Step 3: Initialize variables:
n1 = 0, n2 = 1, i = 2
Step 4: Read n from user
Step 5: Repeat this step until i < = n:
sum = n1 + n2
print sum
n1 = n2
n2 = sum
i = i + 1
Step 6: STOP
OR
Question 34.
Write a program to read a list of n integers (positive as well as negative). Create a dictionary
with the numbers as
keys and store the square of the number if it is negative or cube of the number if it is positive.
[5]
OR
Write a Python program that takes a list of integers as input and prints the top k numbers with
the highest frequency. [5]
Answer:
numbers = []
n = int(input("Enter the number of elements in the list: "))
for i in range(0, n) :
num = int(input("Enter the element: ") )
numbers.append(num) k = int (input("Enter the value of k: ") )
frequency = { }
for num in numbers:
frequency[num] = frequency.get(num, 0) + 1
sorted_numbers = sorted(frequency, key=lambda x: frequency[x],
reverse=True)
top_k_numbers = sorted_numbers[:k]
print(top_k_numbers)
Question 35.
Write a program to check if a number is palindrome without converting to string or any other
data-structure, i.e., the reverse of the number is the number itself. [5]
Answer: