Students must start practicing the questions from CBSE Sample Papers for Class 11 Computer Science with Solutions Set 2 are designed as per the revised syllabus.

Recommended Reading On: Java 1 4 1 – Java Program to Print Series 1 4 9 16 25 36 …N

CBSE Sample Papers for Class 11 Computer Science Set 2 with Solutions

Time Allowed: 3 hours
Maximum Marks: 70

General Instructions:

  • All questions are compulsory.
  • Attempt all parts of each question
  • Internal choices are given, choose any one of them.

Question 1.
(a) Karuna’s teacher today told her that Strings in Python are immutable. She is confused as to what is meant by this, select the most appropriate explanation for immutable. [1]
(A) it can’t hold a new value
(B) A string cannot be manipulated
(C) it’s value once initialized can not be changed.
(D) all of these
Answer:
Option (C) is correct.

(b) Initialization means giving name to a list. (True/ False) [1]
Which of the following is not a valid identifier? [1]
(A) Mybook
(B) @book
(C) _book
(D) book@
Answer:
True

(c) The ______ operator is used to find out if division of two numbers yield any remainder: [1]
(A) /
(B) +
(C) %
(D) //
Answer:
Option (B) and (D) are correct.

Commonly Made Error:
It must be noted that special symbols like !, @, #, $, % etc. are not identifiers.

Answering Tip
In Python, identifiers are combination of upper case and lower case letters (A to Z or a to z), digits(0-9) and ! underscore. Special symbols like @,&,$ etc., keywords not supported by Python.

CBSE Sample Papers for Class 11 Computer Science Set 2 with Solutions

(d) An ______ appears if the user tries to access an element which does not exist in a list. [1]
(A) NameError
(B) ValueError
(C) KeyError
(D) IndexError
Answer:
Option (C) is correct.

Explanation:
% (modulo) operator, returns the remainder of diving the left hand operand by right hand operand.

(e) An appears if the user tries to access an element which does not exist in a list.
(A) NameError
(B) ValueError
(C) KeyError
(D) IndexError
Answer:
Option (D) is correct

Explanation:
Index Error means your code is trying to access an index that is invalid. This is usually because the index goes out of bounds by being too large.

(f) What is the difference between extend)) function and append() function? [2]
Answer:
The extend () function adds one list at the end of another list, while append() function adds only a single item at the end of a list.

(g) List some precautions to be taken while using emails. [2]
Answer:
Precautions to be taken while using emails are:

  • Don’t download or open unsolicited email attachments.
  • Be careful of an email that asks you to verify your personal details.
  • Review your web browser setting regularly.
  • Disconnect from the internet when you are away.

(h) Lists are just like dynamically sized arrays, declared in other languages (vector in C+ + and ArrayList in Java). In a simple language, a list is a collection of things, enclosed in [ ] and separated by commas. Lists are the simplest containers that are an integral part of the Python language. Lists need not be homogeneous always which makes it the most powerful tool in Python. A single list may contain DataTypes like Integers, Strings, as well as Objects. Lists are mutable, and hence, they can be altered even after their creation. [5]
1. Which of the following statement will create list?
(A) L1 = list()
(B) L1 = [1,2,3,4]
(C) Both of the above
(D) None of the above
Answer:
Option (C) is correct.

2. Which of the following is True regarding lists in Python?
(A) Lists are immutable.
(B) Size of the lists must be specified before its initialization
(C) Elements of lists are stored in contagious memory location.
(D) size(listl) command is used to find the size of lists.
Answer:
Option (C) is correct.

Explanation:
Elements of lists are stored in contagious memory location is tree regarding list in python.

3. Which of the following would give an error?
(A) list1 = []
(B) list1 = []*3
(C) list1 = [2,8,7]
(D) None of the above
Answer:
Option (D) is correct.

Explanation:
All of the statements are correct. So, none of the errors will show.

4. Write the output of the following code:
> > >L= [1,2,3,4,5,[6,7,8]]
> > >print(L[5])
(A) [6,7,8]
(B) 6, 7, 8
(C) Error
(D) 6
Answer:
Option (A) is correct.

5. Write the output of the following code :
> > > L=[‘w’/e’/l’/c’/o’/m’/e’]
> > > print(len(L))
(A) 7
(B) 8
(C) 9
(D) None
Answer:
Option (A) is correct.

Explanation:
len () function returns the number of item in an object.

CBSE Sample Papers for Class 11 Computer Science Set 2 with Solutions

Question 2.
(a) Python interprets any non-zero value as false. (True/false) [1]
Answer:
False

(b) max() and min() check on the basis of ______ values. [1]
Answer:
ASCII

(c) Explain the significance of exceptional handling [2]
Answer:
Exception handling is ideal for processing unusual situations in a controlled way so that the program ends gracefully rather than terminating abruptly

(d) The elements of a list are arranged in descending order. Siddh used following functions on this list, [2]
(i) print(list_name.sort())
(ii) print(max(list_name))
(iii) print(list_name.reverse())
(iv) print(list_name[-l])
Which two of the above will give same outputs? Explain your answer.
(A) (i) and (ii)
(B) (i) and (iii)
(C) (ii) and (iii)
(D) (iii) and (iv)
Answer:
(B) (i) and (iii).

this is because sort() will sort and arrange the list in ascending order while reverse will reverse the order of all the elements of the list which is in ascending order.

(e) A list Divisibility contains the following elements: [4]
9, 35,4,19, 55,12,55,36
Write a program to swap the content with next value divisible by 5 so that the resultant list will look like
9,4, 35,19,12, 55, 36, 55
OR
How is the import < module > command processed internally?
Answer:
Divisibility = [9, 35, 4, 19, 55, 12, 55, 36]
L1 = len (Divisibility) i = 0
while i < L1:
if Divisibility(i)%5 = = 0:
Divisibility(i)Divisibility(i+1)= Divisibility(i+1), Divisibility(i)
i = i + 2
else:
i = i + 1
print(Divisibility)

OR

When import <module> command is issued, it is internally processed as follows:
(i) First the code of imported module is interpreted and executed.
(ii) Functions and variables that are defined in the module are made available to the program that imported the module.
(ill) A new namespace for the imported module is setup. This namespace has same name as that of the module.

Question 3.
(a) Krrish needs to define a Tu pie. He has forgotten which brackets he should use to define a tuple. can you tell the right answer? [1]
(i) ()
(ii) []
(iii) i>
(iv) <>
Answer:
(i) ()

(b) What is the function of a computer battery ? [1]
Answer:
Function of a computer battery is to power an integrated chip called an RTC or Real – Time Clock which runs even when the system is off.

(c) What are the reason of hacking? [3]
Answer:
Reasons for hacking: [3]
(i) Money
(ii) Leak information
(iii) Disruption
(iv) Spamming
(v) Fun
(vi) Vulnerability Testing.

CBSE Sample Papers for Class 11 Computer Science Set 2 with Solutions

Question 4.
(a) ______ are reserved words in Python. [1]
Answer:
Keyword

(b) Write a program to get the side of a square from the user and print its area. [2]
Answer:
side = int(input(“Enter the side of a square”))
area = side * side
print (“Area of square =” area)

(c) What are the features of Python? [4]
Answer:
Python’s features include:

  • Easy-to-learn: Python has few keywords, simple structure, and a clearly defined syntax. This allows the student to pick up the language quickly.
  • Easy-to-read: Python code is more clearly defined and visible to the eyes.
  • Easy-to-maintain: Python’s source code is fairly easy-to-maintain.
  • A broad standard library: Python’s bulk of the library is very portable and cross-platform compatible on UNIX, Windows, and Macintosh.
  • Interactive Mode: Python has support for an interactive mode which allows interactive testing and debugging of snippets of code.
  • Portable: Python can run on a wide variety of hardware platforms and has the same interface on all platforms.
  • Extendable: You can add low-level modules to the Python interpreter. These modules enable programmers to add or customize their tools to be more efficient.
  • Databases: Python provides interfaces to all major commercial databases.
  • GUI Programming: Python supports GUI applications that can be created and ported to many system calls, libraries and windows systems, such as Windows MFC, Macintosh, and the X Window system of Unix.
  • Scalable: Python provides a better structure and support for large programs than shell scripting.

Question 5.
(a) Draw a flowchart to convert temperature from Fahrenheit to Celsius. [3]
Answer:
CBSE Sample Papers for Class 11 Computer Science Set 2 with Solutions 1
Commonly Made Error:
Students must make use of accurate symbol and shape based on the actions.

Answering Tip:
To convert temperature from Fahrenheit to Celsius the formula is used C = (5*(F-32))/9

(b) What is the significance of UNICODE. [4]
Answer:

  • Unicode enables a single software product or a single website to be designed for multiple platforms, languages and countries which can lead to a significant reduction in cost over the use of legacy character sets.
  • Unicode data can be used through many different systems without data corruption.
  • Unicode represents a single encoding scheme for all languages and characters.
  • Unicode is a common point in the conversion between other character encoding schemes.
  • Unicode is the preferred encoding scheme used by XML- based tools and applications.

Question 6.
(a) What are the rules for identifier names? [2]
Answer:
(a) 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. Python is a case sensitive programming language. Thus, Count and count are two different identifiers in Python.

(b) What type of error will be produced in this: Result = “Python” + 25
Answer:
The error is: TypeError
The error message is: Can’t convert ‘int’ object into ‘str’ implicitly.

(c) Write a program to find the largest number among the three given numbers. [4]
Answer:
A = int (input (“Enter first number :”))
B = int (input (“Enter second number :”))
C = int (input (“Enter third number :”))
if (A > B):
if (A > C) :
print (A, “is the largest number”)
else:
print (C, “is the largest number”)
else:
if (B > C) :
print (B, “is the largest number”)
else:
print (C, “is the largest number”)

CBSE Sample Papers for Class 11 Computer Science Set 2 with Solutions

Question 7.
(a) The antivirus software can alter, corrupt, delete files and freeze your computer. [1]
Answer:
False

(b) What measures should one take to maintain confidentiality of personal information ? [4]
Answer:
We should follow the following to maintain confidentiality of personal information:

  • Never open suspicious texts or emails.
  • Never send money or give your credit card, personal details, bank account details to anyone you don’t know or trust.
  • Choose strong passwords and update them regularly.
  • Secure your devices with antivirus software and good firewall.
  • Avoid using public computers or WiFi hotspots to access or provide personal information.
  • While making online payments, use only secure payment and service.

Question 8.
(a) Abhay read about cybertrolls in a newspaper article. Who or what are trolls?
(i) person who posts demeaning or insulting comments.
(ii) the demeaning or insulting comments posted by someone.
(iii) someone who follows a person.
(iv) both (i) and (ii) [1]
Answer:
(iv) both (i) and (ii)

(b) Mrs. jain is worried abut her daughter’s increasing Social media time. She wants to explain her about some do’s and don’ts of Social media. Can you tell her two each? [4]
OR
Explain IPR
Answer:
Do’s of social media:

  • respect other people’s sentiments
  • while posting your views on some sensitive issue, make it clear that these are your own personal views and heave no relation with the institution or organization you belong to.

Don’t s of social media:

  • Do not use slang as you talk with your small group of friends.
  • Do not use fake identities on social media.

OR

Intellectual Property Rights (IPR) are legal rights governing the use of creations of the human mind. The recognition and protection of these rights is of recent origin. Copyrights, Patents, designs and trademarks are considered as industrial property. Intellectual Property Rights are one’s legal rights in respect of the ‘property’ created by one’s mind – such as an invention, or piece of music, or an artistic work, or a name or slogan or symbol, or a design, which is used in commerce, in the form of books, music, computer software, designs, technological know-how, trade symbols, etc.

These rights are largely covered by the laws governing Patents, Trademarks, Copyright and Designs. These various laws protect the holder of IP rights from third party encroachment of these rights. It also allows them to exercise various exclusive rights over their intellectual property.

(c) A logic gate is a device that acts as a building block for digital circuits. They perform basic logical functions that are fundamental to digital circuits. Most electronic devices we use today will have some form of logic gates in them. For example, logic gates can be used in technologies such as smartphones, tablets or within memory devices. [5]

In a circuit, logic gates will make decisions based on a combination of digital signals coming from its inputs. Most logic gates have two inputs and one output.
AND, OR, NOT are basic logic gates.
1. The output of a two input OR gate is zero, only when
(A) Its both inputs are one
(B) Its either input: is zero
(C) Its both inputs are zero
(D) Its either input is zero
Answer:
Option (C) is correct.

Explanation:
The OR gate is an electronic circuit that gives a high output (1) if one or more of its inputs are high. A plus (+) is used to show the OR operation.

2. What logic function is produced by adding an inverter to each input and output of an OR gate?
(A) NAND
(B) NOR
(C) AND
(D) X-OR
Answer:
Option (C) is correct.

Explanation:
AND logic function is produced by adding an inverter to each input and output of an OR gate. AND gate is an electronic circuit that gives a high output (1) only if all its inputs are high. A dot (.) is used to show the AND operation i.e., A.B.

3. How many two-input AND and OR gates are required to realize Y = CD+EF+G?
(A) 2,2
(B) 2,3
(C) 3.3
(D) 3,2
Answer:
Option (A) is correct.

4. An AND gate can be imagined as
(A) Switches connected in series
(B) Switches connected in parallel
(C) Transistors connected in series
(D) Transistors connected in parallel
Answer:
Option (A) is correct.

5. The output ol an AD gate with three inputs, A, B, and C, is HIGH when
(A) A = 1, B = 1, C = 0
(B) A = 0,B = 0,C = 0
(C) A = 1, B = 1, C = 1
(D) A = 1, B = 0, C = 1
Answer:
Option (C) is correct.

CBSE Sample Papers for Class 11 Computer Science Set 2 with Solutions

Question 9.
(a) Rewnte the code after correcting the errors. [2]
a = int [“Enter a nuumber for a:”]
for in range (1, 15)
if a = b
print “Equal numbers”
else
print “Not equal numbers”
Answer:
a = int (input (“Enter a number for a: “))
for b in range (1, 15) :
if a == b:
print (“Equal numbers”)
else:
print (“Not equal numbers”)

(b) Write some commonly made syntax errors. [2]
Answer:

  • Missing Parenthesis
  • Incorrect Indentation
  • Wring spelling and keywords
  • Missing Colon