Students must start practicing the questions from CBSE Sample Papers for Class 11 Computer Science with Solutions Set 3 are designed as per the revised syllabus.
CBSE Sample Papers for Class 11 Computer Science Set 3 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 program controls a particular type of hardware connected to a computer? [1]
(A) Compiler
(B) Interpreter
(C) Device Driver
(D) Source Program
Answer:
(C) Device Driver
Explanation:
A device driver is a software that tells the operating system and other software how to communicate with a piece of hardware. Some examples of devices that need drivers are hard drives, DVD drives, and PCI cards.
Question 2.
Simplify the boolean expression, and choose the correct option: [1]
A+AB+ ABC+ABCD + ABCDE
(A) 1
(B) A
(C) A+ AB
(D) AB
Answer:
(B) A
Explanation:
By Absorption law.
A+AB+ABC+ABCD+ABCDE
= A(1+B+BC+BCD+BCDE)
= A(1) {By Dominance Law}
= A {By identity law}
Question 3.
The binary equivalent of the octal number 65.203 is [1]
(A) (110101.010000011)2
(B) (110001.010000011)2
(C) (110101.010000010)2
(D) (110101.010000001)2
Answer:
(A) (110101.010000011)2
Explanation:
Convert each octal digit into a three- bit binary number.
Question 4.
Which of the following can be used as a valid variable identifier(s) in Python? [1]
(A) 3thAdd
(B) Total
(C) Digit#
(D) 2Data
Answer:
(B) Total
Explanation:
Rules for writing an identifier
- Identifiers can be a combination of letters in lowercase (a to z) or uppercase (A to Z) or digits (0 to 9) or an underscore (_).
- An identifier cannot start with a digit. 1variable is invalid, but variable1 is perfectly fine. Keywords cannot be used as identifiers.
- We cannot use special symbols like !, @, #, $, % etc. in our Identifier. Identifiers can be of any length.
Question 5.
Which of the following will give an error? [1]
(A) a=b=c=1
(B) a,b,c=1
(C) a,b, c=1, ‘python’, 1.5
(D) None of the above
Answer:
(B) a,b,c=1
Explanation:
a,b,c = 1 will give an error in Python. This will give an error because there is only one value (1) on the right side, but three variables (a, b, and c) on the left side.
Question 6.
Which of the following is not ‘open source’ software? [1]
(A) Linux
(B) Ubuntu
(C) Open Office
(D) Windows 10
Answer:
(D) Windows 10
Explanation:
The term open source refers to software development refers to expert developers collaborating worldwide. For example, Linux Kernel-based operating systems like Ubuntu and Fedora come under Free and Open Source Software.
Question 7.
Identify the correct arithmetical operation. [1]
(A) a = 1*2
(B) 2 = 1+1
(C) 5 + 6 = y
(D) Seven = = 3 *4
Answer:
(A) a = 1*2
Explanation:
Few rules of writing expression:
Write the variables to the LHS of the assignment operator always.
Always use a single equal sign (=) to assign a value to a variable.
Write the Arithmetic expression to the RHS of the assignment operator.
Question 8.
Identify the data type that stores data in the form of key-value pair. [1]
(A) List
(B) Tuple
(C) String
(D) Dictionary
Answer:
(D) Dictionary
Explanation:
A dictionary can be created by placing items inside curly braces { } separated by a comma. Syntax:
={‘key1′:’value1’, ‘key2’: ‘value2’,.., ‘keyn’:’valuen’}
Question 9.
Raghav wants to write a program to check whether a number is prime or not For this, he should have a good understanding of ____. [1]
(A) while loop
(B) for loop
(C) conditional statement
(D) all of these
Answer:
(D) all of these
Explanation:
A while loop or a for loop can be used to iterate through a range of numbers to repeatedly divide the number and check for factors. Conditional statements are used to make decisions based on the results of the checks.
Question 10.
Identify the value of ‘x’ that makes the condition False in the following code. [1]
if (x > 10 or x == 2) and (x!=12):
print(“Hello”)
(A) 2
(B) 12
(C) 18
(D) 24
Answer:
(B) 12
Explanation:
for x=12
if (x > 10 or x == 2) and (x!=12):
⇒ if(12>10 or 12 ==2) and (12! = 12)
⇒ if (True or False) and (False)
⇒ if True and False
⇒ if False
Question 11.
What will be the output of the following code? [1]
st1=”Language” st2=st1.replace (‘a’ , ‘A’) print (st2)
(A) LAnguAge
(B) Language
(C) LAnguage
(D) LanguAge
Answer:
(A) LAnguAge
Explanation:
replace() function in the string is used here to replace all the existing “a” with “A” in the given string.
Question 12.
What will be the output? [1]
ls1 [‘ab’,’cd’] ls2 = [2, 3] print (ls1+ls2)
(A) (‘ab’+2, ‘cd’+3]
(B) [‘ab’, ‘ab’, ‘cd’, ‘cd’, ‘cd’J
(C) [‘ab’2, ‘cd’3]
(D) [’ab’, ‘cd’, 2, 3]
Answer:
(D) [’ab’, ‘cd’, 2, 3]
Explanation:
+ operator used in list to concatenate the multiple lists.
Syntax:
list3 = list1 + list2
Question 13.
Identify the tuple with single element. [1]
(A) tup = (10,)
(B) tup = 10,
(C) Both (A) and (B)
(D) None of these
Answer:
(C) Both (A) and (B)
Explanation:
If a tuple comprises of a single element, the element should be followed by a comma. Such a tuple is called a singleton tuple.
Creating a tuple with a single element:
Syntax:
tuple_name = (Value,) OR tuple_name = tuple( ) OR tuple_name = Value,
Question 14.
What will be the output? [1]
d= {“a” : 10, “b” : 15, “C” : 20} print (d[0])
(A) a
(B) 10
(C) {“a”:10}
(D) Error
Answer:
(D) Error
Explanation:
The dictionary items cannot be accessed using list-like indexing. You need to use the keys to access the corresponding values from a dictionary. In the given dictionary there is no key as 0, and hence it will give KeyError
Question 15.
What is/are a component of the IT Act 2000? [1]
(A) Legal Recognition of digital signatures
(B) Regulation of Certification Authorities
(C) Digital Certificates
(D) All of these
Answer:
(D) All of these
Explanation:
Some of the important concepts introduced in the IT ACT, 2000 are:
- Electronic record
- Secure electronic record
- Digital signature
- Secure digital signature
- Certifying authority
- Digital signature certificate.
Question 16.
Intellectual Property Rights protect the use of information and ideas that are of: [1]
(A) Ethical Value
(B) Moral Value
(C) Social Value
(D) Commercial Value
Answer:
(D) Commercial Value
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.
This enables the creator or copyright owner to earn recognition or financial benefit by using their creations or inventions.
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): The act of presenting someone else’s work or idea as your own is Plagiarism.
Reason (R): Accessing someone’s information without their permission is Plagiarism. [1]
Answer:
(C) A is True but R is False
Explanation:
Accessing someone’s information without their knowledge is called ‘cracking’. So R is wrong, but Assertion is the correct definition of Plagiarism.
Question 18.
Assertion (A): Compile time error occurs at the time of program compilation.
Reason (R): Compile time errors occur during the execution of a program. [1]
Answer:
(C) A is True but R is False
Explanation:
Run time errors occur during the execution of a program.
Section B
[Each question carries 2 marks]
Question 19.
What are universal gates? Mention any 2. [2]
(i) Obtain the Boolean Expression for the logic circuit shown below:
(ii) What is fallacy?
Answer:
Universal gates are logic gates that can be used to implement any logic function, and also any other logic gates. Two examples of universal gates are NAND Gate, and NOR Gate
OR
(i) F = (A’.B)’ + (C + D’)
(ii) If the result of any logical statement or expression is always FALSE or 0 it is called Fallacy.
Question 20.
Express the following hexadecimal numbers into equivalent decimal numbers. [2]
(i) 4A2
(ii) 9E1A
(iii) 6BD
(iv) 6C.34
Answer:
(i) (4A2)16 = 4 × 162 + 10 × 161 + 2 × 160 = (1186)10
(ii) (9E1A)16 = 9 × 163 + 14 × 162 + 1 × 161 + 10 × 160
= (40474)10
(iii) (6BD)16 = 6 × 162 + 11 × 161 + 13 × 160 = (1725)10
(iv) (6C.34)16 = 6 × 161 + 12 × 160 + 3 × 16-1 + 4 × 16-2
= (108.203125)10
Question 21.
What is run time error? Underline the runtime error in the following program.
x = int(input("Enter the value of x:")) y = 0 z = x/y
OR
Draw a flowchart to find sum of digits of a number.
Answer:
Run time errors occur during the execution of a program and are also known as exceptions. z = x/y # Division by zero.
Here, x/y will generate the run time error.
OR
Question 22.
A string sub = “Computer Science” is defined. [2]
Give Python statements to:
(A) Display last three characters of sub.
(B) Display starting index of ‘ute’.
(C) Check whether ‘enc’ is contained in sub or not.
(D) Repeat sub four times.
OR
Consider the following list myList. What will be the elements of myList after the following two operations? [2]
myList = {10, 20, 30, 40}
(i) myList.append ([50, 60] )
(ii) myList.extend ([80, 90])
Answer:
The Python statements are:
(A) sub[-3:]
(B) sub.find(‘ute’)
(C) ‘enc’ in sub
(D) sub*4
OR
(i) [10, 20, 30, 40, [50, 60] ]
(ii) [10, 20, 30, 40, [50,60] , 80,90]
Question 23.
Consider the following dictionary: [2]
stateCapital = {"AndhraPradesh":"Hyderabad", "Bihar": "Patna", "Maharashtra":"Mumbai", "Raj ashthan":"Jaipur"}
Find the output of the following statements:
(i) print (stateCapital .get (“Bihar”) )
(ii) print(stateCapital.keys ( ))
(iii) print(stateCapital.values ( ))
(iv) print (stateCapital.items ( ))
OR
Why is following code not giving correct output even when 25 is a member of the dictionary?
dic1 = {'age': 25, 'name': 'xyz', 'salary': 23450.5} val = did [ 'age' ] if val in dic1: print("This is member of the dictionary") else : print("This is not a member of the dictionary")
Answer:
(i) Patna
Explanation: get ( ) function returns the value corresponding to the key passed as an argument.
(ii) dict_keys([‘AndhraPradesh’, ‘Bihar’, ‘Maharashtra’, ‘Rajashthan’])
(iii) dict_values([‘Hyderabad’, ‘Patna’, ‘Mumbai’, ‘Jaipur’])
Explanation: values ( ) ‘ function returns the list of the values in the dictionary.
(iv) dict_items([{‘AndhraPradesh’: ‘Hyderabad’), (‘Bihar’, ‘Patna’), (‘Maharashtra’, ‘Mumbai’), (‘Rajashthan’, ‘Jaipur’}])
Explanation: items( ) function returns the list of tuples in key value pair.
OR
The code is not giving the desired output because 25 is present in dic1 as a value and not as a key. “val in dic1” only checks val in the keys of dictionaries. We can get the desired output by changing val in dic1 to val in dic1.values().
Question 24.
What are cookies? [2]
Answer:
Cookies are small text files that websites store on a user’s device when the user visits the website. These files contain information about the user’s interaction with the website and are used to remember certain preferences or track their activities.
Question 25.
Distinguish between Open Source Software and Proprietary Software. [2]
Answer:
Open Source Software | Proprietary Software | |
1. | Source Code is available. | Source code is not available. |
2. | Modification to source code can be done by anyone. | Modification to source code can only be done by designated people. |
3. | Supported by community of users and developers. | Supported by vendors at a cost. |
4. | Generally no license fee Example: Open office | License fee is charged Example: Microsoft office |
Section C
[Each question carries 3 marks]
Question 26.
(i) Name one input and one output device used for sound. [1 + 2 = 3]
(ii) Define Software. Give its types.
Answer:
(i) Input device – Microphone Output device – Speakers
(ii) Software is a set of programs that controls the operation of a computer system and utilizes hardware.
Types of software are:
- System Software
- Application Software.
Question 27.
(i) What does mapping mean? What kind of data type is based on mapping? [2 + 1 = 3]
(ii) int (‘a’) produces error. Why ?
Answer:
(i) Mapping refers to the process of associating elements from one set to elements of another set.
A data type based on mapping is a dictionary. It allows you to store and retrieve data using key-value pairs.
(ii) int() converts its numeric argument into an integer.
As ‘a’ is a letter, it cannot be converted into a valid integer hence int(‘a’) produces an error.
Question 28.
Consider the following string my Address: [3]
myAddress = "WZ-1, New Ganga Nagar, New Delhi"
What will be the output of the following string operations?
(i) print (myAddress . lower ()]
(ii) print(myAddress.upper()]
(iii) print(myAddress.count(‘New’))
(iv) print (myAddress.find (‘New’) )
(v) print (myAddress.rfind ( ‘New’) )
(vi) print (myAddress.split(‘,’))
OR
What will be the output of the following code segment?
(i)
L=["Delhi", "Goa", "Kanpur"] print(L*2)
(ii)
L1=["Suman", "Gauri", "Kunal"] L2=["Delhi", "Goa", "Kanpur"] print(L1==L2)
(iii)
L = [2, 1, 5, 3, -4, -2, -6, 7, 5] print(L[2 : : 3])
(iv)
L = [2, 4, 7, 9] L.extend([1, 3, 5, 6, 8, 10]) print(len(L))
(v)
L=[7, 2, 4, 8, 1, 9, 8] print(L[0]+L.index(8))
(vi)
(L= [1, 6, 3, 5, 6, 6, 6, 7] print('L[L[L[L[2]+1]]])
Answer:
(i) wz-1, new ganga nagar, new delhi
(ii) WZ-1, NEW GANGA NAGAR, NEW DELHI
(iii) 2
(iv) 6
(v) 23
(vi) [‘WZ-1’, ‘ New Ganga Nagar’, ‘ New Delhi’]
Explanation:
find() returns the index of first occurrence of the given substring, whereas rfind() returns the index of the first occurrence from the right, i.e., the last occurrence.
OR
(i) [‘Delhi’, ‘Goa’, ‘Kanpur’, ‘Delhi’, ‘Goa’, ‘Kanpur’]
(ii) False
(iii) [5, -2, 5]
(iv) 10
Explanation:
Extended list is [2, 4, 7, 9, 1, 3, 5, 6, 8, 10]
(v) 10
Explanation:
print(L[0]) | 7 |
print(L.index(8)) | 3 |
L.index() returns the index of the first occurrence of the element
(vi) 6
Explanation:
print( L[2]+1) | 4 |
print( L[4]) | 6 |
print( L[6]) | 6 |
print( L[6]) | 6 |
Question 29.
Consider the following tuple :
T= (9, 1, 3, 8, 1, 2, 3, 2, 2, 3, 3, 5, 7, 0, 1)
What will be the output of the following tuple operations?
(i)
print (T [-1: 5 :-1] )
(ii)
print ([T[i] for i in range (0, len(T), 2)])
(iii)
print(2 in T)
(iv)
print(sum(T, 3))
(v)
res = T.count(2) print(res)
(vi)
del T[3] print(T)
Answer:
(i) (1, 0, 7, 5, 3, 3, 2, 2, 3)
(ii) [9, 3, 1, 3, 2, 3, 7, 1]
(iii) True
(iv) 53
Explanation:
In the above case, 3 is the starting value to which the sum of the elements of tuple is added to.
(v) 3
(vi) TypeError: ‘tuple’ object doesn’t support item deletion
Question 30.
After practicals, Atharv left the computer laboratory but forgot to sign off from his email account. Later, his classmate Revaan started using the same computer. He is now logged in as Atharv. He sends inflammatory email messages to few of his classmates using Atharv’s email account. [3]
i. Revaan’s activity is an example of which of the following cyber crime?
a. Hacking
b. Identity theft
c. Cyber bullying
d. Plagiarism
Answer:
b. Identity theft
Explanation:
Identity theft is a type of fraud that involutes using someone else’s identity to steal money or gain other benefits.
ii. If you post something mean about someone, you can just delete it and everything will be Ok.
a. True
b. False
Answer:
b. False
iii. Anonymous online posts/comments can be traced back to the author.
a. Always
b. Never
c. Sometimes
Answer:
a. Always
Section D
[Each question carries 4 marks]
Question 31.
Write any four effects of cyber bullying and trolling ? [4]
Answer:
Cyber bullying and trolling harass victims mentally and physically. Many changes in behaviour of victims of cyber bullying and trolling can be seen. Some are as follows:
- Emotional distress and low self-esteem: Cyber- bullying and trolling can cause severe emotional harm, leading to feelings of fear, sadness, and diminished self-worth.
- Social isolation and damaged relationships: Victims may withdraw from social interactions, feel alienated, and experience strained relationships due to the harassment.
- Academic and professional setbacks: The constant online harassment can disrupt focus, impacting academic performance and potentially hindering career prospects.
- Physical health implications: Prolonged exposure to cyberbullying can result in stress-related symptoms like headaches, sleep disturbances, and decreased appetite.
Question 32.
(i) Study the following program and select the possible output(s) from the options (i) to (iv) following it. [2 + 2 = 4]
Also, write the maximum and the minimum values that can be assigned to the variable Y.
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
(ii) Write the output of the following:
import statistics
a. print(statistics.mean([1, 2, 3, 4, 5]))
b. print(statistics.median([1, 3, 5, 7, 9]))
c. print(statistics.median([1, 3, 5, 7, 9, 11]))
d. print(statistics.mode([1, 3, 3, 2, 2, 3, 4, 5, 2, 3]))
Answer:
(i) (i) and (iv) are the possible outputs. Minimum value that can be assigned to Y = 0. Maximum value that can be assigned to Y = 4
(ii)
a, 3
b, 5
c, 6 .0
d, 3
Section E
[Each question carries 5 marks]
Question 33.
(i) Draw a flowchart to find the sum of first ‘n’ odd numbers. Accept ‘n’ from the user. [2+3=5]
(ii) Explain different types of flow of control.
OR
Write a program to accept percentage and display the category according to the following criteria:
Percentage | Category |
<40 | Failed |
> =40 & <55 | Fair |
>=55& <65 | Good |
>=65 | Excellent |
Answer:
(i)
(ii) There are three types of flow of control:
- Sequential flow: It has events occurring in a sequence one after the other without being dependent on any condition.
- Selective flow: Here the flow of control gets branched based on whether a particular condition evaluates to true or false.
- Iterative flow: Here a sequence of steps is performed iteratively until some condition is met.
OR
percentage = int(input("Enter the percentage: ")) if percentage >= 65: print("Excellent") elif percentage >= 55: print("Good") elif percentage >= 40: print("Fair") else: print("Failed")
Question 34.
Write a program to read a list of elements. Sort the numbers. Now, input an element from the user and insert it while maintaining the sorted order. [5]
Answer:
n = int (input("How many elements you want to enter in a list?")) ol= [ ] for i in range(n): e = int(input("Enter the element : ")) ol.append(e) ol .sort() ne = int(input("Enter new element : ")) c=0 for i in ol: c=c+1 if i< ne: continue else: ol.insert(c-1, ne) break print("List after inserting new element is : ", ol)
OUTPUT:
How many elements you want to enter in a list?5
Enter the element : 12
Enter the element : 23
Enter the element : 34
Enter the element : 45
Enter the element : 56
Enter new element : 20
List after inserting new element is : [12, 20, 23, 34, 45, 56]
Question 35.
Write a complete Python program to do the following: [5]
(i) Read an integer X.
(ii) Determine the number of digits n in X.
(iii) Form an integer Y that has the number of digits n at ten’s place and the most significant digit of X at one’s place.
(iv) Find the common factors of both X and Y.
(v) Output the factors.
(For example, if X is equal to 2134, then Y should be 42 as there are 4 digits and the most significant number is 2).
OR
Write a program that should prompt the user to type some sentence(s) followed by “enter”. It should then print the original sentence(s) and the following statistics relating to the sentence(s):
- Number of words
- Number of characters (including white-space and punctuation)
- Percentage of characters that are alphanumeric
Hints: Assume any consecutive sequence of non-blank characters is a word.
Answer:
(i) read an integer X.
x = int(input("Enter a number: "))
(ii) determine the number of digits n in X.
n = len(str(x))
(iii) form an integer Y that has the number of digits n at ten’s place and the most significant digit of X at one’s place.
y = int(str(n) + str(x)[0])
(iv) Find the common factors of both X and Y.
factors = [] for i in range(1, min(x, y) + 1): # Running a loop from 1 to the minimum of x and y, and checking if i is a factor of both x and y. if x % i == 0 and y % i == 0: factors.append(i)
(v) Output the factors.
print ("The common factors of {} and {} are {}".format(x, y, factors))
OR
str = input("Enter a few sentences: ") length = len(str) spaceCount = 0 alnumCount = 0 for ch in str: if ch.isspace(): spaceCount += 1 elif ch.isalnum(): alnumCount += 1 alnumPercent = alnumCount / length * 100 print("Original Sentences:") print(str) print("Number of words =", (spaceCount + 1)) print("Number of characters =", (length + 1)) print("Alphanumeric Percentage =", alnumPercent)