Students must start practicing the questions from CBSE Sample Papers for Class 12 Informatics Practices with Solutions Set 5 are designed as per the revised syllabus.

CBSE Sample Papers for Class 12 Informatics Practices Set 5 with Solutions

Time Allowed: 3 hours
Maximum Marks: 70

General Instructions:

  1. This question paper contains five sections, Section A to E.
  2. All questions are compulsory.
  3. Section A have 18 questions carrying 01 mark each.
  4. Section B has 07 Very Short Answer type questions carrying 02 marks each.
  5. Section C has 05 Short Answer type questions carrying 03 marks each.
  6. Section D has 03 Long Answer type questions carrying 05 marks each.
  7. Section E has 02 questions carrying 04 marks each. One internal choice is given in Q35 against part c only.
  8. All programming questions are to be answered using Python Language only.

Section – A

Multiple Choice Questions

Question 1.
What will be the output of the following code?
import pandas as pd
import numpy
s=pd.Series (data = [31, 54, 34, 89,12,23],
dtype=numpy.int)
print (s>50)

(A)
0 False
1 True
2 False
3 True
4 False
5 False
ditype:bool
(B)
1 54
3  89
dtype:int64
(C)
0 31
1 54
2 34
3 89
4 12
5 23
dtype:int64
(D)
1 True
3 true
dtype:bool

Answer:
Option (A)
Explanation: s>50 will iterate over each element of the series and check if the condition is true. [1]

Question 2.
Mr. Raman created a DataFrame from a Numpy array:
arr = np.array ([[2,4,8, ], [3, 9,27], [4,16, 64]])
df=pd.DataFrame (arr,index = [‘one’,’two’,three’],____)
print(df)
Help him to add a customized column labels to the above DataFrame-
(A) columns=’no’,’sq’,’cube’
(B) column = [‘no,’sq’,cube’]
(C) columns= [‘no’,’sq’,’cube’]
(D) columns= [[‘no’, ‘sq’, ‘cube’]]
Answer:
(C) columns= [‘no’,’sq’,’cube’]
Explanation: The syntax to create a dataframe is <dataframe object>= panda.DataFrame(<a 2D structure>,[columns = <column sequence>], [index = <index sequence>]). [1]
Here column names are to be provided as a sequence along with the columns argument. So we will provide here columns as a list. [1]

CBSE Sample Papers for Class 12 Informatics Practices Set 5 with Solutions

Questions 3.
PyPlot is an interface of Python’s ___ library.
(A) seaborn
(B) plotly
(C) ggplot
(D) matplotlib [1]
Answer:
(D) matplotlib
Explanation: Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. There are various plots which can be used in Pyplot are Line Plot, Contour, Histogram, Scatter, 3D Plot, etc. [1]

Question 4.
Write the output of the following SQL command:
SELECT left(“Jammu Region”, 5);
(A) Region
(B) Jammu
(C) Jammu Region
(D) None of the above. [1]
Answer:
(B) Jammu
Explanation: LEFT extracts a number of characters from a string (starting from left) [1]

Question 5.
Write the output of the following SQL command: select round(458.45, -1);
(A) 450
(B) 460
(C) 458
(D) 500 [1]
Answer:
(B) 460
Explanation: ROUND( ): Function is used to round up the number to the upwards or downwards whichever the nearest whole number [1]

Commonly Made Error:
Sometimes Students get confused between positive and negative integer length.

Answering Tip:
For positive integer with Negative length, it rounds the number to the nearest tens place. For positive integer with Negative length but length is larger than the number of digits before the decimal point,
SELECT ROUND (457, -1); → 460
SELECT ROUND (457, -2); → 500
SELECT ROUND (457, -3); → 0
SELECT ROUND (457, -4); → 0

Question 6.
Computer Network is:
(A) Collection of hardware components and computers.
(B) Interconnected by communication channels.
(C) Sharing of resources and information.
(D) All of the Above [1]
Answer:
(D) All of the Above
Explanation: A computer network is a set of computers sharing resources located on or provided by network nodes. The computers use common communication protocols over digital interconnections to communicate with each other. [1]

Question 7.
Which device is used to transfer Communication Signal to Long Directions ?
(A) Amplifier
(B) Repeater
(C) Router
(D) All of the Above [1]
Answer:
(B) Repeater
Explanation: A repeater is an electronic device in a communication channel that increases the power of a signal and retransmits it, allowing it to travel further. Since it amplifies the signal, it requires a source of electric power. Use of the term has continued in telephony and data communications [1]

Question 8.
Data protection refers to protecting data from:
(A) Substantial Harm
(B) Embarrassment
(C) Inconvenience and unfairness
(D) All of these [1]
Answer:
(D) All of these
Explanation: Data protection is a set of strategies and processes you can use to secure the privacy, availability, and integrity of your data. [1]

CBSE Sample Papers for Class 12 Informatics Practices Set 5 with Solutions

Question 9.
Typing in all capitals in electronic communications means:
(A) This message is very important.
(B) You are shouting.
(C) It’s okay to forward this message to others.
(D) Nothing special—typing in all caps is normal. [1]
Answer:
(B) You are shouting.
Explanation: Email etiquette is the use of appropriate language, conventions and formality in an email. Write in ALL CAPS. It is considered as SHOUTING on the net. [1]

Question 10.
Write the output of the following SQL command, select substr(“Oswaar,3,4);
(A) waa
(B) waal
(C) swaa
(D) swaal [1]
Answer:
(B) waal
Explanation: The SUBSTR( ) function extracts some characters from a string.
Syntax:
SUBSTR(string, start, length) [1]

Question 11.
Hackers usually used the computer virus for _____ purpose.
(A) To log, monitor each and every user’s stroke
(B) To gain access of the sensitive information like user’s Id and Passwords
(C) To corrupt the user’s data stored in the computer system
(D) All of the above [1]
Answer:
(D) All of the above
Explanation: In general, hackers use computer viruses to perform several different tasks such as to corrupt the user’s data stored in his system, to gain access of the important information, to monitor or log user’s each stroke. [1]

Question 12.
Which of the following is not a type of cybercrime?
(A) Data theft
(B) Forgery
(c) Damage to data
(D) Installing antivirus for protection [1]
Answer:
(D) Installing antivirus for protection
Explanation: The computer may have been used in the commission of a crime, or it may be the target. Cybercrime may harm someone’s security and financial health. [1]

Question 13.
There is only 1 day left for Ravisha to submit her Science project. Therefore she performed the following activities. Which of these can be considered as plagiarism?
(A) Downloaded the images that were marked as CC and pasted in her project file.
(B) Copied the content from some website and pasted in her file.
(C) Copied the content from the website and gave reference about the same in the project.
(D) Downloaded and installed the open source software for typing the synopsis. [1]
Answer:
(B) Copied the content from some website and pasted in her file.

Question 14.
SELECT MOD(15,3); will produce the output as:
(A) 0
(B) 1
(C) 5
(D) Error [1]
Answer:
(A) 0
Explanation: SQL MOD( ) function is used to get the remainder from a division. [1]

Question 15.
SELECT INSTR(‘Language’,’gua’); will produce the output:
(A) 4
(B) 3
(C) 5
(D) -4 [1]
Answer:
(A) 4
Explanation: INSTR( ) function takes two arguments as str (string) and sub_str (sub string) and returns the position of the first occurrence of a specified sub_str from a given str. [1]

Question 16.
Which of the following option is correct output for below statement?
SELECT LEFT (‘Water Park’, 4);
(A) Water
(B) Park
(C) Wate
(D) Wate Park [1]
Answer:
(C) Wate
Explanation: LEFT( ): It is used to return a specified number of characters from the left of the string. The number of characters returned is determined by the second argument. [1]

Assertion & Reason

Directions: In the following questions, a statement of assertion (A) is followed by a statement of reason (R). Mark the correct choice as:
(A) Both assertion (A) and reason (R) are true and reason (R) is the correct explanation of assertion (A).
(B) Both assertion (A) and reason (R) are true but reason (R) is NOT the correct explanation of assertion (A).
(C) Assertion (A) is true but reason (R) is false.
(D) Assertion (A) is false but reason (R) is true

Question 17.
Assertion (A): URL stands for Uniform Run Line.
Reason (R): The First Page we generally view when we open the browser is called home page. [1]
Answer:
(D) Assertion (A) is false but reason (R) is true
Explanation: URL stands for Uniform Resource Locator, and is used to specify addresses on the World Wide Web. A “homepage” or “startup page” is the page your web browser opens when you first run the software, and the page it returns to when you click on the “Home” button in the browser’s toolbar [1]

Question 18.
Assertion (A): A diet can be passed as an input to the Series.
Reason (R): If index is passed, then corresponding values to a particular label in the index will be extracted from the dictionary. [1]
Answer:
(B) Both assertion (A) and reason (R) are true but reason (R) is NOT the correct explanation of assertion (A).
Explanation: A dict can be passed as an input. If there is no index specified, then the dictionary’s keys are taken in a sorted order. If index is passed, then corresponding values to a particular label in the index will be extracted from the dictionary. [1]

Section – B

Question 19.
When is a repeater used in a computer network? [2]
OR
Why switch is called an intelligent hub?
Answer:
A repeater regenerates the signal periodically and hence extends the distance over which data can safely travel. We need a repeater when the total length of a single span of network cable exceeds 100 meters. [2]
OR
Switches learn the location of the devices that they are connected to almost instantaneously. The net result is that most network traffic only goes where it needs to rather than to every port. On busy networks, this can make the network significantly faster.

Question 20.
Write the name of functions which:
(i) returns length of a string.
(ii) returns specified number of characters from a string. [2]
Answer:
(i) LENGTH( )
(ii) SUBSTR( ) [2]

CBSE Sample Papers for Class 12 Informatics Practices Set 5 with Solutions

Question 21.
Riya is using a table Employee.
It has the following columns:
Code, Name, Fees, Course
She wants to display minimum fees Departmentwise. She wrote the following statement:
SELECT Code, MIN(Fees) FROM College;
But she did not get the desired result. Rewrite the above query with necessary changes to help her get the desired result. [2]
Answer:
SELECT Code, MIN(Fees) FROM College GROUP BY Code; [2]

Question 22.
Define the following terms:
(i) .loc[ ]
(ii) .iloc[ ] [2]
Answer:
(i) .l°c[ ] : This attribute is used to access a group of rows and columns by label(s) or a boolean array in the given Series object.
Syntax Series.loc
(ii) .iloc : This attribute enables purely integer location based indexing for selection by position over the given series object.
Syntax Series.iloc [2]

Question 23.
List the types of IPR. [2]
OR
What is hacking?
Answer:
Types of IPR:

  • Designs
  • Trademark
  • Copy Rights
  • Patents [2]

Commonly Made Error:
Intellectual Property Rights are legal rights governing the use of creations of the human mind.

Answering Tip:
Other types of IPR are Plant variety productions Geographical Indication.

OR
Hacking is the act of unauthorized access to a computer, computer network or any digital system. Hackers usually have technical expertise of the hardware and software. They look for bugs to exploit and break into the system. Hacking, when done with a positive intent is called ethical hacking. Such ethical hackers are known as white that hackers. They are specialists in exploring any vulnerability or loophole during testing of the software. [2]

Question 24.
Write the output of following code:
import pandas as pd
data = [ ‘a’ , ‘b’ , ‘c’ , ‘d’ , ‘e’ ]
df = pd.DataFrame(data)
print (df) [2]
Answer:
Output

0 a
1 b
2 c
3 d
4 e

[2]

Question 25.
Give the output:
import pandas as pd
data = [[‘Kiyaan’ , 15], [‘Kasish’ , 22], [‘Aadi’, 23]] –
dfl = pd.Dataframe (data, columns = [‘Name’,’Age’])
print (dfl) [2]
Answer:
Output

Name Age
0 Kiyaan 15
1 Kasish 22
2 Aadi 23

[2]

Section – C

Question 26.
Write the output of the SQL statements for the following table :
Table: Book

Book. Id Book_Name Author_Name Publisher Price Type Quantity
C0001 Fast Cook Lata Kapoor Oswaal 355 Cookery 5
F0001 The Tears Villiam Hopkins Fist Publ. 650 Fiction 20
T0001 My First C++ Brain \& Brooke Oswaal 350 Text 10
T0002 C++Brain Work A.W. Rossiane TDH 350 Text 15
F0002 Thunderbolts Anna Roberts Fist Publ. 750 Fiction 50

(i) SELECT COUNTS) FROM Book;
(ii) SELECT MAX(Price) FROM Book WHERE Quantity > = 15;
(iii) SELECT COUNT(DISTINCT Publisher) FROM Book WHERE Price > = 400; [3]
Answer:
(i) 5
(ii) 750
(iii) 1 [3]

Question 27.
Consider two objects X and Y. X is a list where as Y is a Series. Both have values 20,40,55, 95,125.
What will be the output of the following two statements considering that the above objects have been created already?
(a) print (X*2)
(b) print(Y*2)
Justify your answer. [3]
Answer:

(a) It will give the output as:
[20, 40, 55, 95, 125, 20, 40, 55, 95, 125]

(b) It will give the output as:

0 40
1 80
2 110
3 190
4 250

Justification: In the first statement, X represents a list so when a list is multiplied by a number, it is replicated that many number of times.
The second Y represents a series. When a series is multiplied by a value, then each element of the series is multiplied by that number. [3]

Question 28.
Create an array in the range 5 to 50 with values 0*5 apart. Create another array with values of log of first array. Plot a graph of first vs second array, specify the x-axis title as ‘Random values’ and y-axis title as ‘log values’. Plot the graph with dash dotted lines. [3]
Answer:
import numpy as np
import matplotlib.pyplot as plt
a=np.arange(5, 50, 0.5) b=np.log(a)
plt.plot(a, b, linestyle=’dashdot’)
plt.xlabel(‘Random values’)
plt.ylabel(‘log values’)
plt. show ( ) [3]

CBSE Sample Papers for Class 12 Informatics Practices Set 5 with Solutions

Question 29.
What are the effects of cyber bullying and trolling? [3]
OR
Define the e-mail Etiquettes.
Answer:
Cyber bullying and trolling harass victim mentally and physically. There are so many changes in victim of cyber bullying and trolling can be seen.
Some are as follows:
(i) Due to cyber bullying and trolling, victims lose their self-stream. They start keeping negative thoughts about themselves.

(ii) Victim stops talking to their friends and family or talk rarely. They seen worried about something. They feel that they can’t come out from what is happening on web.

(iii) Cyber bullying affects a person deeply. It changes a person’s way of thinking even an optimist person become pessimist due to cyber bullying or trolling.

(iv) Cyber bullying and trolling cause serious effect on victims even sometimes victims could not handle it then this becomes the reason of their sudden demise.

(v) There can be seen huge effects of cyber bullying on teenager. Even the study says maximum victim of cyber bullying is of teenage group. Teenagers who are bullied are likely to experience depression, unhappiness and poor sleep, worry. [3]

OR

Write a clear concise subject line that reflects the body of the e-mail. Avoid subject lines with general works like, “Hi”, and “Hello” and do not leave the subject line blank. Always use an appropriate greeting. Beginning your e-mail with phrases such as Good Morning, Good Afternoon etc. Be aware that funny sayings or colloquialisms may be completely misconstrued by your colleagues in overseas offices.

(i) Always state if your e-mail needs are action and by when. Open-ended e-mails can be confusing. Having a further action is required is helpful.

(ii) Don’t hit reply all. It can be annoying to be copied into every e-mail or to see every response in a chain if it is not relevant to your recipient.

(iii) Never use inappropriate language in an e-mail. The reality is that your e-mail will remain on the server long after you have deleted it. [3]

Question 30.
Write the output of the following SQL queries:
(i) SELECT MID(‘Examination’, 4, 3);
(ii) SELECT INSTR(‘INFORMATION’, ‘FOR’);
(iii) SELECT LENGTH (‘Examination’);
OR
Consider the following SQL string: “Commission”
Write commands to display:
(i) “mission”
(ii) “mis”
(iii) 10
Answer:
(i) min
(ii) 3
(iii) 11 [3]
OR
(i) SELECT MID (“Commission”, 4);
(ii) SELECT SUBSTR(“Commission” ,4,3);
(iii) SELECT LENGTH (“Commission”);

Section – D

Question 31.
Give the output for the following queries (i) to (iv) based on table GARMENT:

GCODE GNAME SIZE COLOUR PRICE
111 TShirt XL Red 1400.00
112 Jeans L Blue 1600.00
113 Skirt M Black 1100.00
114 Ladies Jacket XL Blue 4000.00
115 Trousers L Brown 1500.00
116 Ladies Top L Pink 1200.00

(i) SELECT COUNT(DISTINCT SIZE) FROM GARMENT;
(ii) SELECT AVG (PRICE) FROM GARMENT;
(iii) SELECT GNAME, COLOUR FROM GARMENT WHERE SIZE = ‘M’;
(iv) SELECT GNAME, COLOUR FROM GARMENT WHERE PRICE > = 3000;
(v) What is the primary key of the table GARMENT?
OR
Which function is used to return the remainder of one expression by dividing it to another expression? Explain with example.
Answer:
CBSE Sample Papers for Class 12 Informatics Practices Set 5 Img 3
OR
The MOD( ) function returns the remainder of one number divided by another. The following shows the syntax of the MOD() function: MOD(dividend,divisor)
The MOD( ) function accepts two arguments:

(i) dividend is a literal number or a numeric expression to divide.
(ii) divisor is a literal number or a numeric expression by which to divide the dividend.

The MOD( ) function returns the remainder of dividend divided by divisor, if the divisor is zero, the MOD(dividend, 0) returns NULL.

MySQL MOD( ) function examples
The following statement divides the number 11 by 3. It returns 2 as the integer portion of the result:
mysql> SELECT MOD(11, 3);
Here is the output:
2
MySQL allows you to use the modulus operator (%) which is the synonym for MOD( ) function as follows:
mysql>SELECT 11 % 3;
The output is:
2
MySQL MOD Function Modulus Operator Example The MOD( ) function also works on values with a fractional part and returns the remainder after division. See the following example: mysql> SELECT MOD(10.5, 3);
The following picture illustrates the output:
1.5 [5]

Question 32.
Inshika Industries has set up its new production unit and sales office at Ranchi. The company compound has 4 buildings as shown in the diagram given : [5]
CBSE Sample Papers for Class 12 Informatics Practices Set 5 Img 1
Distances between these buildings are as follows:

Administrative office to Factory A 150 mt
Factory A to Factory B 50 mt
Factory B to Sales office 100 mt
Sales office to Administrative office 200 mt
Administrative office to Factory B 125 mt

Number of computers in each of the buildings are:

Administrative office 15
Factory A

Factory B

Sales office

25

18

15

(i) Suggest a cable layout of connections between the buddings so that each building is directly connected to Administrative office.
(ii) Suggest the most suitable place (i.e. building) to house the server of this production unit with a suitable reason.
(iii) Suggest the placement of the following devices with justification :
(a) Repeater
(B) Hub/Switch
(iv) The administrative office of this unit is to be linked with the head office situated in Patiala (Punjab). What will be the most economical way to do this? Justify you answer.
(v) Which type of network out of the following is formed by connecting the computers of these buildings?

  • LAN
  • MAN
  • WAN

Answer:
(i) CBSE Sample Papers for Class 12 Informatics Practices Set 5 Img 4
(ii) Factory A can house the server as it has the maximum number of computers. Since all buildings are connected to the administrative office, the service can also be housed there.
(iii) (a) Repeater is required between
Administrative office and sales office as the distance is more.
(b) Hub/Switch is required in all buildings.
(iv) Radiowaves can be used as they are economical.
(v) LAN [5]

Question 33.
How can you create a DataFrame structure from a dictionary of lists? [5]
OR
What is the Series and how is it different from a 1-D array, a list and a dictionary?
Answer:

List of dictionaries can be passed as input data to create a DataFrame. The dictionary keys are by default taken as column names.
For example :
students = {‘Name’: [‘Rahul’, ‘Sahil’, ‘Muskan’,’Arayn’, ‘Vansh’],
‘Subject’ : [‘Math’, ‘Science’, ‘Computer’, ‘Social’,’English’],
‘Marks’ : [75, 80, 69, 94, 79]}
datastudent=pd.DataFrame(students)
print(datastudent)
Output

Name Subject Marks
0 Rahul Math 75
1 Sahil Science 80
2 Muskan Computer 69
3 Aryan Social 94
4 Vansh English 79

Commonly Made Error:
Some students do not specify index.

Answering Tip:
Index should be specified to avoid errors. If no index is passed, then by default index will be range (n) in the range length.
OR
A series is a one-dimensional array containing a sequence of values of any data type (int, float, list, string, etc) which by default have numeric data labels starting from zero. Series vs Python Lists (1-D Array):
The main difference is the index: while the Numpy Array or Python 1-D Array has predefined integer

index used to access the values i.e. 0, 1, 2 In the Pandas series has an explicitly defined index associated with the values i.e. we can also assign values of other data types as index. Both can store heterogeneous data. Panda Series vs Dictionary Dictionary stores values as key: value pairs, Panda Series are like one-dimensional array. When you convert dictionary to Series object, keys are converted to user-defined indexes.

Section – E

Case based Subjective Questions

Question 34.
Consider the below mentioned table ‘CLOTH’:

DECODE DESCRIPTION PRICE MCODE LAUNCHDATE
10001 Formal Shirt 1250 M001 12-Jan-08
10020 Frock 760 M004 90-Sep-07
10012 Informal Shirt 1450 M002 16-Jun-08
10019 Evening Gown 850 M003 06-Jun-08
10090 Tulip Skirt 860 M002 31-Mar-07
10023 Pencil Skirt 1250 M003 19-Dec-08
10089 Slacks 860 M003 20-Oct-08

Write the commands for (i) and (ii) and output for (iii) –
(i) Display first three letters of description e.g. ‘FRO’ for ‘FROCK’. [1]
(ii) Display the description after removing leading spaces if any. [1]
(iii) SELECT COUNT (DISTINCT MCODE) FROM CLOTH; [2]

OR (Option for part iii only)

SELECT MAX(LAUNCHDATE) FROM CLOTH;
Answer:
(i) SELECT LEFT(DESCRIPTION,3) FROM CLOTH; [1]
(ii) SELECT LTRIM(DESCRIPTION) FROM CLOTH; [1]
(iii)

COUNT(DISTINCT MCODE)
4

OR

MAX(LAUNCHDATE)
19-Dec-08

CBSE Sample Papers for Class 12 Informatics Practices Set 5 with Solutions

Question 35.
Gaurav has written a Python Code to create a bar plot as given below using the following data:

City Happiness_Index Male Happiness_Index Female
Delhi 60 30
Beijing 40 60
Washington 70 70
Tokyo 65 55
Moscow 85 75

CBSE Sample Papers for Class 12 Informatics Practices Set 5 Img 2
import as _____ #Statement 1
City = [‘Delhi’/Beijing’,’Washington’,’Tokyo’, ‘Moscow’]
Gender= [‘Male’/Female’]
Happiness_Index_Male = [60,40,70,65,85]
Happiness_Index_Female = [30,60,70,55,75]
plt.bar([0.25,1.25,2.25,3.25,4.25],Happiness_Index_Male,color=’blue’,label=”Male”,width=.5)
pit. ([.75,1.75,2.75,3.75,’4.75],Happiness_Index_Female,color=’Green’,width=.5,label=”Female”) #Statement 2
pos=range(len(City)) print(pos)
plt.xticks(pos,City,fontsize = 10) plt.xlabel(‘City’, fontsize = 16)
plt.ylabel(‘Happiness_Index’, fontsize=16)
______#Statement 3
______#Statement 4
______#Statement 5
(a) (i) Identify the suitable code to be used in the blank space in line marked as Statement 1. [1]
(ii) What is the name of the function to plot the required bar graph in the line marked as Statement 2 [1]
(b) Fill in the blank in statement 3 to set Chart Title as “Happiness Index across cities by gender “on font size as 18. Also, define the title]) method. [2]
OR (Option for part iii only)
Fill in the blank marked in Statement 5 to display the plot. Also, define this method.
Answer:
(i) (a) matplotlib.pyplot as plt [1]
(b) bar ( ) [1]
(ii) plt.title (“Happiness Index across cities by gender”, fontsize = 18)
The title( ) method in matplotlib module is used to specify title of the visualization depicted and displays the title using various attributes. [2]
OR
plt.show ( )
The show( ) function in pyplot module of matplotlib library is used to display all figures.