CBSE Sample Papers For Class 11 Computer Science Set 1 With Solutions
CBSE Sample Papers For Class 11 Computer Science Set 1 With Solutions
ADVERTISEMENT
General Instructions:
Section A
[Each question carries 1 mark]
ADVERTISEMENT
Question 1.
State True or False: [1]
Meaningful content extracted from data is called information.
Answer:
True
ADVERTISEMENT
Question 2.
Which translator translates one line at a time? [1]
(A) Interpreter
(B) Translator
(C) Simulator
(D) None of these
Answer:
(A) Interpreter
ADVERTISEMENT
Explanation: Both pseudocode and flowcharts serve as tools for algorithm design and
representation, and they can be used separately or together, depending on the preference or
requirements of the developer or designer.
Question 4.
The precise step by step instructions given to perform a task are called [1]
(A) Flowchart
(B) algorithm
(C) SDLC
(D) all of these
Answer:
(B) algorithm
Explanation: The precise step-by-step instructions given to perform a task are called an
algorithm. An algorithm is a well-defined set of instructions or rules that describe a sequence
of operations to solve a specific problem or perform a specific task. It provides a clear and
systematic approach to solving a problem, specifying the order and actions required to
achieve the desired outcome.
Question 5.
What do we use to define a block of code in the Python language? [1]
(A) Key
(B) Brackets
(C) Indentation
(D) None of these
Answer:
(C) Indentation
Explanation: Python uses indentation to define blocks of code. Indentations are simply spaces
or tabs used as an indicator that is part of the indent code child. Indentations are equivalent to
the curly braces in C, C+ + or Java, which indicate a block of code too.
Question 6.
Study the following statement:
>>>”a”+”bc”
What will be the output of this statement? [1]
(A) a+bc
(B) abc
(C) abc
(D) a
Answer:
(B) abc
Explanation: In Python, the “+” operator acts as a concatenation operator between two
strings. So it will concatenate/join both the strings, and result in abc.
Question 7.
_____ occurs when each statement of the block does not have the same indentation. [1]
(A) Logical error
(B) Syntax error
(C) Run time error
(D) Indentation error
Answer:
(D) Indentation error
Explanation: An indentation error occurs when each statement of a block does not have the
same
level of indentation. In programming languages that use indentation for block structures, such
as Python, consistent indentation is crucial for proper syntax and program execution.
Indentation errors can result in syntax errors or unexpected behavior in the program.
Question 8.
If the value of a = 20 and b = 20, then a+ =b will assign ____ to a. [1]
(A) 40
(B) 30
(C) 20
(D) 10
Answer:
(A) 40
Explanation: a+=b implies a = a+b, which is a = 20+20 = 40. The operator adds RHS to LHS
and then assigns it to the variable on the left side.
Question 9.
Which of the following is not a valid identifier? [1]
(A) Mybook
(B) @book
(C) _book
(D) book23
Answer:
(B) @book
Explanation: An identifier starts with a letter A to Z or a to z or an underscore (_) followed
by zero or more letters, underscores and digits (0 to 9). Python does not allow punctuation
characters such as @, & and % within identifiers.
Question 10.
By default, the values of range () in the for loop start from [1]
(A) -1
(B) 0
(C) 1
(D) 10
Answer:
(B) 0
Explanation: The range() function returns a sequence of numbers, starting from 0 by default,
and increments by 1 (by default), and ends at a specified number.
Question 11.
What is displayed when we print an empty string? [1]
(A) 0
(B) 1
(C) Name of the string
(D) Blank space
Answer:
(D) Blank space
Explanation: When an empty string is printed, nothing is displayed. The output will be a
blank line or an empty space, depending on the specific programming environment or console
settings. However,’ there will be no visible characters or content displayed as the string is
empty.
Question 12.
Write the output of the following code: [1]
>>> L=[ 'w' , 'e' , ' l' , ' c' , 'o' ,'m' , ' e' ]
>>> print (len(L))
(A) 7
(B) 8
(C) 9
(D) None
Answer:
(A) 7
Explanation: The code creates a list L with the elements ‘w’, ‘e’, ‘l’, ‘c’, ‘o’, ‘m’, ‘e’. The
len() function is then used to determine the length of the list, which is the number of elements
it contains. In this case, the list L has 7 elements, so the output of print(len(L)) will be 7.
Question 13.
Which of the following is not a function of the tuple? [1]
(A) update( )
(B) min( )
(C) max( )
(D) count( )
Answer:
(A) update( )
Explanation: The update() function is not a built-in function for tuples in Python. The
update() method is typically associated with some mutable data structures like dictionaries,
where it is used to update or modify the elements of the data structure. However, tuples in
Python are immutable, meaning their elements cannot be modified or updated once the tuple
is created. Therefore, the update() function does not apply to tuples.
Question 14.
sorted() can be used to sort the following: [1]
(A) Keys in a dictionary
(B) Dictionary according to the values
(C) Lists
(D) All of these
Answer:
(D) All of these
Explanation: The sorted() function in Python can be used to sort various types of data
structures and iterables, including:
(A) Keys in a dictionary: By passing the dictionary keys as the argument to sorted(), you can
sort and return a new list containing the keys in sorted order.
(B) Dictionary according to the values: You can sort a dictionary based on its values by using
the sorted() function with a custom key argument or by utilizing the itemgetter() function
from the operator module.
(C) Lists: Sorting a list is one of the most common use cases for the sorted() function. It
returns a new sorted list without modifying the original list.
(D) All of these.
Question 15.
Exploring appropriate and ethical behaviors related to online environments and digital media
[1]
(A) Cyber ethics
(B) Cyber security
(C) Cyber safety
(D) Cyber law
Answer:
(A) Cyber ethics
Explanation: It involves understanding and adhering to principles such as respect for privacy,
intellectual property rights, digital citizenship, online etiquette, and responsible online
behavior.
Question 16.
An antivirus software protects against [1]
(A) VIRUS attack
(B) Phishing and pharming
(C) Both (A) & (B)
(D) None of these
Answer:
(C) Both (A) & (B)
Explanation: Antivirus software, originally designed to detect and remove viruses from
computers, can also protect against a wide variety of threats, including other types of
malicious software, such as keyloggers, browser hijackers, Trojan horses, worms, rootkits,
spyware, adware, botnets and ransomware.
Q17 and 18 are ASSERTION AND REASONING based questions. Mark the correct choice
as [1]
(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 (A): The pow() function in Python can be used to calculate the square root of a
number. [1]
Reasoning (R): The pow() function can raise a number to a fractional power, which can be
used to calculate square roots.
Answer:
(A) Both (A) and (R) are true and (R) is the correct explanation of (A)
Explanation: The assertion is true as the pow() function can also calculate the square root by
raising the number to the power of 0.5, which is essentially a square root of any number.
Hence, the reasoning is also true and justified, as by raising a number to fractional power, we
can get square root, e.g., pow(16, 0.5) = 4.0.
Question 18.
Assertion (A): Python modules are stored in files with a “.py” extension, and they allow you
to logically organize your Python code. [1]
Reasoning (R): The “.py” extension is commonly used for Python code files, and modules
provide a way to organize code by grouping related functions, classes, and variables together.
Answer:
(A) Both (A) and (R) are true and (R) is the correct explanation of (A)
Explanation: The assertion is true as the pow() function can also calculate the square root by
raising the number to the power of 0.5, which is essentially a square root of any number.
Hence, the reasoning is also true and justified, as by raising a number to fractional power, we
can get square root, e.g., pow(16, 0.5) = 4.0.
Section B
(Each question carries 2 marks)
Question 19.
Define [2]
(i) POST
(ii) PROM
OR
(ii) PROM stands for Programmable Read Only Memory. It is a control memory in which
stored contents can be altered even after they have been set before.
OR
(i) It is a small amount of very fast memory that is built into the CPU.
(ii) Fetch – Execute Cycle is used to execute a program.
Question 20.
Define Operating system. Give the names of any three operating systems. [2]
Answer:
An Operating System is defined as a collection of programs that coordinates the operations of
computer hardware and software. It acts as a bridge or interface between man and machine.
An Operating system is a system software which is mandatory for all computer systems to
operate. Some commonly used operating systems are Windows, DOS, Android, etc.
Question 21.
Draw a flowchart to calculate the sum of two numbers. [2]
OR
Question 22.
What will be the output of the following statements when inputs are a = 30, b = 20, c = 30?
[2]
print(a<b)
print(b<=c)
print(a<b<=c)
Answer:
False
True
False
Explanation for iii.: This expression combines two comparisons. It checks if a is less than b
and if b is less than or equal to c. Given that a = 30, b = 20, and c = 30, the first comparison a
< b evaluates to False as we established before. In Python, chained comparisons like a < b <
= c are evaluated from left to right. In this case, since the first comparison is False, the
expression will evaluate to False without evaluating the second comparison.
Question 23.
What do you mean by debugging? [2]
OR
OR
Runtime errors are those errors which occur during the execution of the program. It occurs
when statements are correct syntactically but the interpreter cannot execute them correctly,
e.g., divide by zero error.
Question 24.
Write a short note on while loop. [2]
OR
While the test condition remains true, it keeps on repeating the set of instructions, and after
every iteration, checks the condition again. As soon as the condition becomes false, it exits
the loop, and continues with the normal flow of a program.
Syntax
while <test-condition>:
#statement 1
#statement 2
……………….
#statement 3
#code outside the while loop
OR
a. Active Digital Footprint: This type of digital footprint refers to the information
intentionally shared by individuals online. It includes content such as social media posts, blog
articles, comments on websites, photos or videos uploaded, and any other content created and
shared actively.
b. Passive Digital Footprint: Passive digital footprints are created through online activities
that are not consciously shared but are collected by others or generated automatically. It
includes data collected by websites and online services, such as IP addresses, cookies,
browsing history, search queries, and online purchases.
Section C
[Each question carries 3 marks]
Question 26.
Write a pseudocode to find the largest of the three numbers, taken as input from user. [3]
Answer:
OR
Write a python program to convert 5000 secs to hr:mm:ss format. Print the calculated time.
Answer:
secs = 5000
mm = secs//60 #converted into minutes, quotient will be
minutes
ss = secs%60 #The remainder obtained while converting to
minutes, will be expressed in seconds
hr = mm//60 #Similarly converting minutes to hours
mm = mm%60 #Fractional/Remainder will be the remaining minutes
print ('hr :mm: ss', ' hr' , ':' 'mm' , ' :' , 'ss')
Question 28.
Suppose you are collecting money for something. You need ₹ 200 in all. You ask your
parents, uncles and aunts as well as grandparents. Different people may give either ₹ 10, ₹
20 or even ₹ 50. You will collect till the total becomes atleast ₹ 200. Write the algorithm. [3]
Answer:
SET totalMoney = 0
WHILE totalMoney < 200
DO INPUT money
totalMoney = totalMoney + money
END LOOP
Question 29.
What do you understand by Net Etiquettes? Explain any two such Etiquettes. [3]
Answer:
Net etiquettes refer to the proper manners and behaviour we need to exhibit while being
online. These include:
(i) No copyright violation: We should not use copyrighted materials without the permission
of the creator or owner. We should give proper credit to owners / creators of open source
content when using them.
(ii) Avoid cyber bullying: Avoid any insulting, degrading or intimidating online behaviour
like repeated posting of rumours, giving threats online, posting the victim’s personal
information, or comments aimed to publicly ridicule a victim.
Question 30.
List and name any three types of cyber-crimes. [3]
Answer:
Types of Cyber Crimes
[Note: You can choose and write any 3, more given for your reference]
General
Section D
[Each question carries 4 marks]
Question 31.
Consider the following Python code snippet: [4]
Question 32.
Create a dictionary, and count the frequency of each character, i.e., the number of times each
character appears. [4] Answer:
freq = { }
str = input("Enter a string: ")
for i in str:
if i in freq:
freq[i] + = 1
else:
freq[i] = 1
print("Frequency of each character:\n ",freq)
Section E
[Each question carries 5 marks]
Question 33.
Write a program to find the grade of a student when grades are allocated as given in the table
below: [5]
Above 90% A
80% to 90% B
70% to 80% C
60% to 70% D
Below 60% E
ii.
Question 34.
Given a set of 100 integers, draw a flowchart to [5]
(i) count the number of odd and even integers.
(ii) Also find the product of the odd integers and the sum of even integers, in the same
flowchart.
OR
Or
Question 35.
Mention 5 negatives impact of technology on society? [5]
Answer:
The negative impacts of technology on society are: [Note: Write any 5 points only. Here
more are given for reference]
Increased pollution: Advancement in technology has led to more and more manufacturing
units and hence to environmental pollution.
Lack of social skills: the Frequency of interacting personally has been reduced much thus
kids and teenagers are deprived of basic, social manner Poor sleep Habits: Endorsing online
activities have affected the sleeping pattern of people.
Loneliness/Isolation: Engaged in our gadgets we get isolated from the world around us even
if we are in a crowded place.
Addiction: Addiction to technology is becoming stronger every passing day, and therefore
very difficult to live without.
Obesity: Sitting on social media and dependence on technology for minimal tasks like
grocery shopping has led to obesity, Kids don’t feel a need to go out and play with friends
when they can sit back at home and play online games with their online friends
Depression: Dependence on technology and less interaction with fellow human beings can
lead to depression.
Lack of Privacy: People are opening up their private space by giving their information on
other sites thus giving rise to criminal activities.
Overshare on social media has led to the tendency of crossing social boundaries and
cyberstalking has become common.
Children at much younger age get an exposure to online platforms, and social-media which
might bring online hate and shape the child’s mind accordingly This also subjects them to
more sexual/ prohibited engagement online.
Lesser attention span: Constant newsfeed, getting multiple messages in a minute, and
switching application too frequently has led to our mind being programmed for a lesser
attention span on a particular task. Hence remembering and recalling are becoming tough
tasks.
Social Violence & Hatred: People are loosing empathies due to lack of knowledge about
social ethics and hence social violence is increasing.
Eyesight & Hearing Loss: Using earphones, or headphones could cause people to reduce their
hearing after some time. Similarly viewing display/ screen of gadgets for prolonged period of
time results in vision loss.