Students must start practicing the questions from CBSE Sample Papers for Class 11 Computer Science with Solutions Set 1 are designed as per the revised syllabus.
CBSE Sample Papers for Class 11 Computer Science Set 1 with Solutions
Time Allowed: 3 hours
Maximum Marks: 70
General Instructions:
- Please check 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 to 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
[Each question carries 1 mark]
Question 1.
Which of the following is not a point-and-draw device?
(A) Keypad
(B) Trackball
(C) Touch screen
(D) Mouse
Answer:
(A) Keypad
Explanation:
All except the keypad are point-and- draw devices. They are used to rapidly point to and select a graphic icon or menu item from multiple options displayed on the GUI of a screen.
Question 2.
The following logic circuit represents the expression:
(A) (X’.Y) + (Y + Z)’
(B) (X + Y)(Y + Z)
(C) (X.Y)(Y.Z)
(D) (X.Y) + (Y + Z)’
Answer:
(B) (X + Y)(Y + Z)
Explanation:
((X+Y)’ + (Y+Z)’)’
= ((X+Y)’)’ . ((Y+Z)’)’ (De Morgan’s theorem)
= (X+Y) . (Y+Z) (Involution law)
Question 3.
Which of the following is an invalid octal number?
(A) (378)8
(B) (123)8
(C) (487)8
(D) (072)8
Answer:
(A) (378)8
Explanation:
In octal number systems only 0-7 digits are used.
Question 4.
Which of the following are not valid string/strings in Python?
(A) “Hello”
(B) ‘Hello’
(C) “Hello’
(D) “123”
Answer:
(C) “Hello’
Explanation:
We can create a string using either single quotes or double quotes. But the quotes have to be the same at both ends to enclose a particular string properly.
Question 5.
Which of the following is NOT a keyword?
(A) None
(B) True
(C) False
(D) If
Answer:
(D) If
Explanation:
A Keyword is a special word that has a special meaning and purpose. Keywords are reserved and are few. For example : if, else, elif etc. All the Python keywords contain lowercase letters only except False, None and True which have the first letter capital. Since, here If has a capital I, it is not a keyword, as Python is case-sensitive.
Question 6.
The programmers who break into secure systems for malicious purposes are:
(A) crackers
(B) hackers
(C) breakers
(D) burglars
Answer:
(A) crackers
Explanation:
A cracker is an individual who performs cracking or the process of breaking into a computer or a network system. A cracker might be performing cracking for malicious activities, profit or just for a challenge.
Question 7.
The …… operator is used to find out if the division of two numbers yields any remainder.
(A) /
(B) +
(C) %
(D) //
Answer:
(C) %
Explanation:
For example, if a=2 and b=3 then a % b results in 2
Question 8.
Identify the point that can be the difference between a list and a string.
(A) Accessing elements
(B) Slicing
(C) Indexing
(D) Mutability
Answer:
(D) Mutability
Explanation:
Mutable data types can change their values after creation and initialisation. List is mutable, whereas tuples are immutable.
Question 9.
By default, the range of values in for loop starts from …….. in every iteration.
(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 10.
Predict the output.
if True: print (“python”) else: print (“language”)
(A) language
(B) python language
(C) python
(D) language python
Answer:
(C) python
Explanation:
Here condition of if statement is True. So, it will print the expression inside the if statement.
Question 11.
Find the output of the following:
Name = "Python Test" print (Name [ : 7 : -1])
(A) Test
(B) tse
(C) Test
(D) tseT
Answer:
(B) tse
Explanation:
Due to -1 in step, string prints from the last index and prints till index 7.
Question 12.
Which function can increase the number of elements of a list by more than one?
(A) append ( )
(B) extend ( )
(C) insert ( )
(D) pop ( )
Answer:
(B) extend ( )
Explanation:
The extend() method increases the length of the list by the number of elements that are provided to the method, so if you want to add multiple elements to the list, you can use this method.
Question 13.
Consider the tuple
tup = (10, 56, 23, 45, 55, 23, 11, 65, 47,(15, 13), 75)
What will be the output of the following statement?
print(tup[::-3])
(A) (75, 65, 55, 56)
(B) (75, 65, 55, 10)
(C) (75, 65, 55, 56, 10)
(D) Error
Answer:
(A) (75, 65, 55, 56)
Explanation:
Print the tuple in reverse order with a gap of 3. Also (15, 13) is considered a single element, so the next element will be 65 at a gap of 3 elements from 75. Similarly, 55 and 56 will be printed.
Question 14.
Choose the correct output for:
> > >dict(m=8, n =9)
(A) {m=8, n=9}
(B) {‘m’= 8, ‘n’=9}
(C) {‘m’: 8,’n’:9}
(D) {m:n, 8:9}
Answer:
(C) {‘m’: 8,’n’:9}
Explanation:
Convert it into dictionary form. The value before ‘=’ will be the key, and the one on RHS, will be the value.
Question 15.
The digital footprint can be saved in which of the following locations?
(A) Browser settings and web server
(B) Google Drive
(C) Both (A) & (B)
(D) None of the these
Answer:
(C) Both (A) & (B)
Explanation:
Digital footprints are the activities that a person does on the internet, which builds up their identity. The user activities like preferences are stored in browser settings and web-servers as cache. Also, when someone uses Google Drive, they leave behind a shadow of their behavior and preferences of what they store and review.
Question 16.
Violation of intellectual property rights may happen by
(A) Plagiarism
(B) Copyright Infringement
(C) Trademark Infringement
(D) All the these
Answer:
(D) All the these
Explanation:
Intellectual property refers to the inventions, literary and artistic expressions, designs and symbols, names and logos. The ownership of such concepts lies with the creator or the holder of the intellectual property. Plagiarism, copyright and/or trademark infringement are ways of using someone’s work as your own without giving credit.
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
Question 17.
Assertion (A): Intellectual Property refers to the inventions, literary and artistic expressions, designs and symbols, names and logos.
Reason (R): Intellectual Property is legally protected through copyrights. [1]
Answer:
(B) Both A and R are true and R is not the correct explanation for A
Explanation:
Given assertion is correct as the intellectual property encompasses a broad range of creations and innovations. Also, the Reasoning statement is correct that Intellectual property is protected through copyrights. However, it is not a reason of why Intellectual Property refers to the given creations.
Question 18.
Assertion (A): If a=2 and b=3 then 2%3 results 2. [1]
Reason (R): Modulus returns remainder when left-hand operand is divided by right-hand operand.
Answer:
(A) Both A and R are true and R is the correct explanation for A.
Explanation:
Modulo operator returns the remainder when 2 operands are divided. Here, when 2 is divided by 3, it gives a remainder of 2 and quotient of 0. Therefore, the Assertion and Reason are both true, and R is the correct explanation of A.
Section B
[Each question carries 2 marks]
Question 19.
Verify the following using truth table: [2]
(i) X. X’ = 0
(ii) X + 1 = 1
OR
(i) Obtain the Boolean expression for the logic circuit shown below:
(ii) State and verify the associative law using the Truth table.
Answer:
(i)
X | X’ | Y=X.X’ |
0 | 1 | 0 |
1 | 0 | 0 |
(ii)
X | 1 | X+1 |
0 | 1 | 1 |
1 | 1 | 1 |
OR
(i)
(ii) Associative law states that
(A + B) + C = A + (B + C)
(A.B).C = A.(B.C)
Hence from the truth table we can say that (A + B) + C = A + (B + C)
Question 20.
Write the binary equivalent of the following octal numbers.
(i) 2306
(ii) 5610
(iii) 742
(iv) 65.203
Answer:
(i) (2306)8 = (010011000110)2
(ii) (5610)8 = (101110001000)2
(iii) (742)8 = (111100010)2
(iv) (65.203)8 = (110101.010000011)2
Explanation:
Each octal digit is converted to equivalent 3 digits of binary.
Question 21.
What are expressions and statements? [2]
OR
Write the pseudocode to print all multiples of 5 between 10 and 25 (including both 10 and 25).
Answer:
An expression is a combination of values, variables, operators, and calls to functions. If you type an expression at the Python prompt, the interpreter evaluates it and displays the result:
>>> 1 + 1
>>> 2
A statement is an instruction that the Python interpreter can execute. When you type a statement on the command line, Python executes it.
For example, a = 1 is an assignment statement. if statement, for statement, while statement etc. are other kinds of statements.
OR
FOR num = 10 to 25 DO If num % 5 = 0 THEN PRINT num END IF END LOOP
Question 22.
Rewrite the following code in Python after removing all syntax error(s). Underline each correction done in the code. [2]
STRING = "WELCOME" NOTE "" for s in range [0, 8]: print (STRING[s]) print s STRING
OR
Define a list. Name a python function to:
(a) delete a given element from the list.
(b) add an element at the beginning of the list
Answer:
STRING = "WELCOME" NOTE = " " for s in range (0,7 ): print (STRING[s] ) print(s, STRING)
OR
A list is a mutable sequence of values which can be homogenous or heterogeneous. python function
(a) remove()
(b) insert(0, )
Question 23.
Define dictionary. Can lists and tuples be used as keys to dictionaries? [2]
OR
Predict the output and justify your answer:
Odd = [1,3,5] print( (Odd +[2, 4, 6]) [4] ) print( (Odd +[12, 14, 16])[4] - (Odd +[2, 4, 6])[4] )
Answer:
A dictionary is a mapping of unique keys to values. Dictionaries are mutable.
Tuples can be used as keys to dictionaries but lists cannot be used.
Explanation:
The keys of dictionaries are immutable, so they can only accept those datatypes which are immutable and hence tuples can be keys, but not lists.
OR
4
10
Explanation:
Odd + [2, 4, 6] will return [1, 3, 5, 2, 4, 6]. The element at index 4 of this list is 4 so the first output is 4. (Odd +[12, 14, 16])[4] is 14 and (Odd + [2, 4, 6])[4] is 4. 14 – 4 = 10 which is the second output.
Question 24.
You got an SMS from your bank querying a recent transaction. Answer the following –
(a) Will you SMS your PIN to the given contact number?
(b) Will you call the bank helpline number to recheck the validity of the SMS received? [2]
Answer:
(a) No, I will not SMS my pin because the bank never asks for such private information.
(b) Yes, because it can be a case of fraud so bank must be informed so they can help and track down the fraudsters.
Question 25.
List any four benefits of e-waste management. [2]
Answer:
The benefits of e-waste management are:
- Saves the environment and natural resources
- Allows for recovery of precious metals
- Protects public health and water quality
- Saves landfill space
Section C
[Each question carries 3 marks]
Question 26.
(i) How do different components of the computer communicate with each other? [1+2=3]
(ii) What do you mean by Input Unit ? Give examples of Input Devices.
Answer:
(i) The main components of the computer communicate with each other, through the System bus. Keyboard, Monitor and Memory are only things which use the system bus to communicate with the CPU, etc
(ii) Input Unit: An input unit takes the input and converts it into a digital signal so that it can be accordingly converted to binary and then understood by CPU for processing accordingly.
For example: Keyboard, Mouse, Joystick, Scanner, Camera, Magnetic Ink Character Reader (MICR), Bar Code Reader (BCR), etc.
Question 27.
What is the use of type () function? Write the output of the following. [3]
(i) type (20)
(ii) type (’20’)
(iii) type (True)
(iv) type (‘False’)
Answer:
type() function tells us about the data type of a variable.
- <class ‘int’>
- <class ‘str’>
- <class ‘bool’>
- <class ‘str’>
Question 28.
(i) What is the use of * operator in strings? [1+2=3]
(ii) Consider the string str=”Global Warming”. Write statements in Python to implement the following
(A) To display the last four characters.
(B) To display the substring starting from index 4 and ending at index 8.
(C) To check whether string has alpha-numeric characters or not
(D) To trim the last four characters from the string.
OR
(i) If a is [1, 2, 3], what is the difference (if any) between a * 3 and [a, a, a] ?
(ii) What is the difference between the following lines of codes?
code1 : list1=[1, 3, 5, 6] list2=list1 code2: list1=[1, 3, 5, 6] list2=list1.copy()
Answer:
(i) The ‘*’ operator acts as a replication operator in strings and repeats the first operand number of times given by the second operand. i.e. print
“You”*5 will print
“You” 5 times repeatedly.
(ii) (a) print str[-4:]
(b) print str[4:8]
(c) str.isalnum( )
(d) str[:-4]
OR
(i) a*3 will produce [1, 2, 3, 1, 2, 3, 1, 2, 3], means a list of integers and [a, a, a] will produce [[1, 2, 3], [1, 2, 3], [1, 2, 3]], means a list of lists.
(ii) In code1 no new list is created instead a reference to the old list i.e. list1 is created and whenever a change is made in any of the two, the other reflects it . In code2 a new copy of the list1 is created which is independent from the older one i.e. list1. Any change made in either of them will not be reflected in the other one.
Question 29.
What is a tuple? What is the difference between the following statements? [3]
(i) t= (‘a’, ‘b’,’ c’)
(ii) a,b,c=t
(iii) t = (0)
(iv) t= (0,)
Then find the consumer’s surplus at the equilibrium price p0 = 20.
Answer:
A tuple is an immutable sequence of values which can be of any type.
Statement (i) will create a tuple with elements ‘a’, ‘b’ and ‘c’.
Statement (ii) will store the elements of the tuple in variables a, b and c. i.e. unpack the tuple t.
Statement (iii) creates a variable with value 0.
Statement (iv) creates a tuple t with a single element 0.
Explanation/Hint:
In parts iii & iv, without a ‘,’, python will treat the element as a single parenthesized value, therefore it will not be a tuple type. But in (iv), due to the comma, the single value will also be considered as a part of tuple.
Question 30.
Raman wanted to gift his brother a football or a wrist watch. So he searched for many sports items and wrist watches online. But after that every time he goes online, his web browser shows him advertisements about sports items and wrist watches. [3]
(A) Why is this happening?
(B) How could have Raman avoided them?
(C) How can Raman get rid of this now?
Answer:
(a) This is happening because third-party cookies saved his search preferences and now websites are posting advertisements based on his preferences.
(b) Raman could have avoided this by privately browsing i.e. opening the web browser in incognito mode before searching for such things, as his preferences would not have been saved then.
(c) Now Robin can delete all the previous history and cookies stored on his computer. This would stop websites from posting advertisements.
Section D
[Each question carries 4 marks]
Question 31.
Differentiate between Copyright and Patent with 2 points each. [4]
Answer:
Copyright | Patent |
Copyright is a legal protection granted to original works of authorship, such as literary works, artistic creations, music, films, and software. | A patent is a legal protection granted to inventors for new and useful inventions or innovations. |
Copyright protection is automatic upon the creation of an original work and does not require registration (although registration may be beneficial for certain legal purposes). | Patent protection requires a formal application process with a patent office, which examines the inventions novelty, non-obviousness, and utility. |
Question 32.
Write Python expression for given mathematical expressions. [1+3=4]
(i) a+b/(x-y)4
(ii) (cos x + tan x)/4
(iii) Explain the difference between import and from import.
Answer:
(i) a + b / math.pow((x = y), 4)
(ii) (math.cos(x) + math.tan(x))/4
(ii)
import < module name> | from < module name> import* |
The statement imports entire module i.e., everything defined inside the module. | This statement only imports the specified items from the module. |
For accessing any object we need to use dot notation i.e., <module name> .object. | We can access any object without using dot notation by just writing the name of the object. |
Section E
[Each question carries 5 marks]
Question 33.
(i) Write an algorithm that performs the following: Ask a user to enter a number. If the number is between 5 and 15, write the word GREEN. If the number is between 15 and 25, write the word BLUE, if the number is between 25 and 35, write the word ORANGE. If it is any other number, write that ALL COLOURS ARE BEAUTIFUL. [2+2+1=5]
(ii) Draw a flowchart to find reverse of a number input by the user.
(iii) How is the decision box different from other flowchart symbols?
OR
(i) Convert the for loop into while loop. [1+1+3=5]
for x in range (8, 24, 4) :
print (x)
(ii) Convert the while loop into for loop.
num = 7 while (num < 21): print (num * 2) num += 3
(iii) What is an infinite loop in Python. Create one using a while loop. Also, what does ‘continue’ and ‘break’ statement do?
Answer:
(i)
Step 1: INPUT n Step 2: IF n>5 And n<15 THEN Step 3: PRINT "GREEN" Step 4: ELSE IF n>15 And n<225 THEN Step 5: PRINT "BLUE" Step 6: ELSE IF n>25 And n<35 THEN Step 7: PRINT "ORANGE" Step 8: ELSE PRINT "ALL COLOURS ARE BEAUTIFUL" Step 9: End IF
(ii)
(iii) All flowchart symbols have one input flow line and one output flowline whereas the decision box has one input and two outputs, flowlines.
OR
(i)
x = 8 while (x < 24): print (x) x += 4
(ii) for num in range (7, 21, 3):
print (num * 2)
(iii) An infinite loop is a loop that continues indefinitely without a condition that can make it terminate naturally. It keeps repeating the loop’s body without ever exiting.
while True:
#loop body statements
The ‘continue’ statement allows you to skip the remaining code within the current iteration and move on to the next iteration, while the ‘break’ statement terminates the loop entirely, regardless of the loop’s condition, and continues execution after the loop.
Question 34.
Write a program to arrange all odd numbers on the left side of the list and even numbers on the right side of the list, for example [5]
original List: L [23, 44,65, 78, 34, 21, 9]
output List: L [9, 21, 65, 23.44, 78, 34].
OR
(i) Find the output generated by following code fragments and justify your answer: [2]
t2 = (4, 5, 6) t3 = (6, 7) t4 = t3 + t2 t5 = t2 + t3 print(t4) print(t5)
(ii) Which of the following will result in an error for a given valid dictionary D? [3]
- D + 7
- D * 7
- D + {7: “7″)
Answer:
L = [23, 44, 65, 78, 34, 21, 9] for i in L: if i%2!=0: k= L.index(i) L.insert(0, L.pop(k)) print(L)
OUTPUT:
[9, 21, 65, 23, 44, 78, 34]
OR
(i) Output
(6, 7, 4, 5, 6)
(4, 5, 6, 6, 7)
Explanation:
Concatenate operator concatenates the tuples in the same order in which they occur to form new tuple. t2 and t3 are concatenated using + operator to form tuples t4 and t5.
(ii) D + 7 — This will result in an error as dictionary does not support + operation.
D * 7 — This will result in an error as dictionary does not support * operation.
D + {7 : “7”} – This will result in an error as dictionary does not support + operation.
Question 35.
Write a program to calculate the distance between the nearest 2 points from a list of x,y coordinates. The list will be like [(x1, y1), (x2, y2),……… (xn,yn)]. You can consider any coordinates on your own, e.g., [(1, 2), (3, 4), (5, 6), (7, 8), (9, 10)] [5]
Answer:
import math coordinates = [(1, 2), (3, 4), (5, 6), (7, 8), (9, 10)] distances = [] # Running loop till the second last element as we are comparing the current element with the next element for i in range(0, len(coordinates)-1): point1 = coordinates [i] # First point point2 = coordinates[i+1] # Second point distance = math.sqrt((point2[0]- pointl[0])**2 + (point2[1]- point1[1])**2) # Calculating distance between two points distances.append(distance) print(min(distances)) #min() will return the minimum value from the list