IP Answer Key Class XII
IP Answer Key Class XII
IP Answer Key Class XII
General Instructions:
SECTION A
You have been given the column ‘Score’ in the table 'SPORTS', which
contains the scores of different games as (5, NULL, 2, 5).
What will be the output when calculating the average of the scores obtained
by different games?
i. 4
ii. 3
iii. 3.5
iv. 5
Ans: i
5. Riya, a student in class XII, has downloaded a CSV file from the internet for [1]
her project. However, she does not want the previous data, which is in the
first five rows of the file, for her data analysis. She wants to skip the previous
data while importing the CSV file into the dataframe. Help her to skip the first
5 rows of the CSV file by choosing the right argument in read_csv().
i. skip_rows = 5
ii. noread - 5
iii. skiprows = 5
iv. skip - 5
Ans: i
6. Which of the following SQL query is use to retrieve the string ‘INDIA’ from [1]
the text “&& INDIA &&”.
i. SELECT TRIM('&&') FROM '&& INDIA &&';
ii. SELECT TRIM('&&' FROM '&& INDIA &&');
iii. SELECT TRIM('&& INDIA &&' FROM '&&');
iv. SELECT TRIM('&&INDIA&&');
Ans: ii
Ans: iii
8. Ramandeep is a young woman with great aspirations and has a good team [1]
of like - minded people. She along with her team members started a
company to sell handicrafts online and also designed a logo for their
company. What type of intellectual property does this logo represent?
i. Patents
ii. Trademark
iii. Design
iv. Copyright
Ans: iv
i. Index Error
ii. 2
iii. Feb
iv. Jan
Ans: ii
i. length( )
ii. instring( )
iii. substr( )
iv. left( )
Ans: ii
Ans: iv
13. What is the significance of the statement "HAVING COUNT (emp_id)>2" in [1]
the following MySQL statement?
SELECT name, COUNT (emp_id),emp_no FROM department GROUP BY
name HAVING COUNT (emp_id)>2;
i. Selecting those rows whose total emp_id>2
ii. Both filter out all rows whose total emp_id below 2 and selecting
those rows whose total emp_id>2
iii. Filter out all rows whose total emp_id below 2
iv. None of these
Ans: ii
14. Rahul wants to disable cookies in his browser. Under which of the following [1]
browser settings options/panels can Rahul disable the cookies?
i. Home Panel
ii. Search Panel
iii. Privacy and Security Panel
iv. General Panel
Ans: iii
The above guidelines for proper handling and disposal of e-waste have been
issued by whom?
16. Out of the following, which function cannot be used for customization of [1]
charts in Python?
i. xlabel()
ii. color()
iii. title()
iv. xticks()
Ans: ii
17. Assertion (A): Pandas.head() is an attribute of the Python data structure. [1]
Reason (R): It is used to display the first/top 5 records of any
series/dataframe.
i. Both A and R are true and R is the correct explanation of A.
ii. Both A and R are true but R is not the correct explanation of A.
iii. A is true but R is false.
iv. A is false but R is true.
Ans: iv
18. Assertion (A): Privacy of sensitive data can be implemented by encryption. [1]
Reason(R): Encryption hides (Encodes) the details of the Actual data.
SECTION B
19. Mention any four differences between Internet & WWW. [2]
OR
Lia is doing a course in Web Technologies. As a part of her project, she
needs to extend and modify the functionality of her web browser. She has
opted to use add-ons or plug-ins to boost the performance of the browser.
However, she doesn’t know the difference between these tools. Help her
understand the difference between add-ons and plug-ins with an example.
Ans:
INTERNET WORLD WIDE WEB (WWW)
Internet is a means of WWW is a collection of information
connecting a computer to which is accessed via the Internet.
any other computer
anywhere in the world.
Internet is primarily WWW is more software-oriented as
hardware-based. compared to the Internet.
b.
print(num.iloc[______________ , _____________])
Ans:
a. print(num.loc[[1,3],['C1','C2']])
b. print(num.iloc[[2,3],2])
or
print(num.iloc[2:4,2])
21. Consider the following table BOOK. [2]
Give the output of the following SQL commands on the basis of the above
table BOOK.
SELECT LEFT (Publication, 1) FROM BOOK WHERE Price > 280;
Ans:
LEFT (Publication, 1)
y
b
22. Ruhi has just designed a website for her boutique ‘Grace’ in HTML language [2]
and now she needs a web address for the page. Briefly discuss about URL
and its components to uniquely identify web resources with a suitable
example.
URL is Uniform Resource Locator and provides the location and mechanism
(protocol) to access the resource.
http://www.grace.bou.in/categories/kids/dress.htm
23. Complete the given Python code to get the required output as “Italy” from [2]
the given dataframe ‘populations’:
import pandas as ps
pop = [ [ ’Italy’,61,0.83],[ ’Spain’,46,0.63],[ ’Greece’,11,0.15] ]
populations = _______________(pop, _______ = [ ’Country’, ’Population’ ,
’Percent’],
________ = [ 1,2,3])
print(populations.loc[ ________________)
Ans:
import pandas as ps
pop = [['Italy',61,0.83],['Spain',46,0.63],['Greece',11,0.15]]
populations = ps.DataFrame(pop,columns =
'Country','Population','Percent'], index = [1,2,3])
print(population.loc[1,'Country'])
24. Kaushal writes the following commands with respect to a table student [2]
having fields name, rollno, marks and records of 5 students.
Ans:
import pandas as pd
I=['Hydrogen','Helium','Lithium','Beryllium']
D1=['H','He','Li','Be']
D2=[1,2,3,4]
S1=pd.Series(D1,I)
print("First Series: ")
print(S1)
S2=pd.Series(D2,I)
print("Second Series: ")
print(S2)
D = {'Symbol': S1,'Atomic Number': S2}
DF=pd.DataFrame(D)
print("DataFrame:")
print(DF)
SECTION C
26. Consider the following records in ‘STUDENT’ table and answer the given [3]
questions:
ii.
iii.
27. Write python code to create a Dictionary ‘dict’ to store rollno, name and [3]
marks of three students. Convert dict into DataFrame df and display the
DataFrame df.
Ans:
import pandas as pd
dict ={'roll':(1,2,3),'name':('a','b','c'),'marks':(24,53,66)}
df=pd.DataFrame(dict)
print (df)
28. In the database ‘Hospital’, create a table named ‘patient’ based on the [3]
following specifications:
Ans:
CREATE TABLE patient (PID VARCHAR(5) PRIMARY KEY, PName
VARCHAR(30), Gender CHAR(1) NOT NULL);
29. Riti received a message that she needs to update the KYC for her Bank [3]
Account; therefore, she should upload her Aadhar Card, Bank Account
Number, and OTP to the link given in her message. Answer the following
questions:
i. Should Riti upload the documents and give the OTP on the link?
ii. What is the act mentioned in the message known as?
iii. Under which act can she lodge a complaint with the relevant
authorities?
iv. Suggest her any two precautionary measures that she should take in
the future while being online to avoid any such situations.
OR
Kartik is fond of playing computer games. What are the different health
hazards that can occur due to excessive use of computer or smart phone
screens, and how can the health hazards be addressed?
Ans:
i. No
ii. Phishing
iv. Call her bank immediately to recheck the validity of the message
received.
Never share personal credentials like username and password with others
OR
32. Mr. Sharma, a game developer, has plotted a chart to estimate the
distribution of two different ratings of the various games available in the Play
Store, as shown below:
He is trying to write the following statements to plot the graph. Help Mr.
Sharma to fill up the blanks with Python code to get the desired output.
import pandas as pd
__________________ # statement 1
df = _________( # statement 2
{'Games':['Subway','Surfer','Temple Run','Candy Crush','Bottle Shot','Runner
Best'], 'Rating1':[15,5,6,18,20,15], 'Rating2':[25,10,28,45,32,30] } )
Write the Python statement to export the dataframe created to the CSV file
named “DATA”, which is in the “D” drive.
Ans:
i. import matplotlib.pyplot as mat
ii. pd.DataFrame
iii. df.plot(kind = 'bar', x = 'Games',
y = ['Rating1','Rating2'])
OR
df.to_csv("D:\\DATA.csv")
SECTION E
Ans:
i. Star Topology
OR Bus Topology
ii. The most suitable place to house the server is Training Compound as it
has maximum number of computers.
OR
The most suitable place to house the server is Training Compound as it has
least distance.
iii.
a. Repeater: As per one layout (shown in (i)), the repeater can be avoided
as all distances between the compounds are <=100 m.
Between Training & Main compound & Training & Finance
b. Hub/Switch: In all the compounds.
iv. Optical Fibre
v. VoIP (Voice Over Internet Protocol)
35. The table below shows the marks of two students for the four-unit tests for [5]
academic session 2022-2023. Plot a line graph for each student with test
names on the X axis, marks on the Y axis, and a legend in the upper right of
the chart. Also, save the figure obtained.
OR
You are provided with the following data on the number of students who
participated in a programming competition over the years:
Create a bar graph to visualize the growth of participants over the years.
Give appropriate labels and also save the figure obtained.
Ans:
import matplotlib.pyplot as plt
Tests= ['Unit1','Unit2','Unit3','Unit4']
Rohit = [85,88,89,87]
Suman = [97,99,90,92]
plt.plot(Tests, Rohit)
plt.plot(Tests, Suman)
plt.legend(['Rohit','Suman'],loc = 'upper right')
plt.xlabel('Tests')
plt.ylabel('Marks')
plt.show()
plt.savefig('chart.png')
OR
import matplotlib.pyplot as plt
years = [2018, 2019, 2020, 2021]
participants = [150, 180, 210, 250]
plt.bar(years, participants, color='blue')
plt.xlabel('Year')
plt.ylabel('Participants')
plt.title('Growth in Participants Over the Years')
plt.show()
plt.savefig('chart.png')