Students must start practicing the questions from CBSE Sample Papers for Class 12 Informatics Practices with Solutions Set 10 are designed as per the revised syllabus.
CBSE Sample Papers for Class 12 Informatics Practices Set 10 with Solutions
Time Allowed: 3 hours
Maximum Marks: 70
General Instructions:
- This question paper contains five sections, Section A to E.
- All questions are compulsory.
- Section A has 18 questions carrying 01 mark each.
- Section B has 07 Very Short Answer type questions carrying 02 marks each.
- Section C has 05 Short Answer type questions carrying 03 marks each.
- Section D has 02 questions carrying 04 marks each.
- Section E has 03 questions carrying 05 marks each.
- All programming questions are to be answered using Python Language only.
Section – A
Question 1.
A shareware is [1]
(a) free of cost
(b) freely available for a limited period
(c) has some restrictions for use
(d) Both (b) and (c)
Answer:
(d) Both (b) and (c)
Question 2.
Bulk volume of calls/messages from looking to be authorised sources is an example of _____. [1]
(a) cyber stalking
(b) bullying
(c) IPR infringement
(d) phishing
Answer:
(d) phishing
Question 3.
The savefig() function is ____. [1]
(a) saves a DataFrame
(b) saves a Series
(c) saves a panel
(d) saves a graph
Answer:
(d) saves a graph
Question 4.
Open office is a/an ………. [1]
(a) documentation
(b) spreadsheet
(c) presentation
(d) office application suite
Answer:
(d) office applications suite
Question 5.
Which of the following performs a pre-defined task and returns some type of result? [1]
(a) Database
(b) SQL function
(c) Implementation
(d) None of these
Answer:
(b) SQL function
Question 6.
Method or function to add a new row in a DataFrame is [1]
(a) .loc()
(b) .iloc()
(c) join()
(d) add()
Answer:
(a) .loc()
Question 7.
____ is not an e-Waste?
(a) Books
(b) Laptop
(c) Monitor
(d) Motherboard
Answer:
(a) Books
Question 8.
Given the code:
datastud=[['Shreya’, 20, 30], ['Rakhi', 23, 50], ['Priya', 45, 90]] dfs=pd.DataFrame(datastud)
The statement to add the column names ‘Name’,‘Eng’,’IP’ to the DataFrame will be
(a) dfs.fields= [‘Name’,‘Eng’, ‘IP’ ]
(b) dfs.rows= [‘Name’,‘Eng ’,‘IP’]
(c) dfs.columns=[‘Name’ ,’ Eng’, ‘IP’]
(d) None of these
Answer:
(c) dfs.columns=[‘Name’, ‘Eng’, ‘IP’]
Question 9.
…………. refers to stealing of required information by seeking and exploting weakness in a computer. [1]
(a) Piracy
(b) Hacking
(c) Digital Property Rights
(d) Trademark
Answer:
(b) Hacking
Question 10.
Write the output of the following SQL query.
SELECT INSTR('INTERNATIONAL', 'NA')
(a) 5
(b) 6
(c) 11
(d) 2
Answer:
(b) 6
Question 11.
The …………. translates Internet domain and host names to IP address.
(a) Domain Name System (DNS)
(b) Routing Information Protocol (RIP)
(c) Internet Relay Chart (IRC)
(d) Network Time Protocol (NTP)
Answer:
(a) Domain Name System (DNS)
Question 12.
The return type of POWER( ) function is [1]
(a) String
(b) Date
(c) Numeric
(d) None of these
Answer:
(c) Numeric
Question 13.
Which of the following proves a website to be authentic? [1]
(a) Padlock
(b) Digital certificate
(c) Starting with https://
(d) All of these
Answer:
(d) All of these
Question 14.
A table “Transport” in a database has degree 3 and cardinality 8. What is the number of rows and columns in it? [1]
(a) 3, 8
(b) 8, 3
(c) 11, 5
(d) 5, 11
Answer:
(b) 8, 3 15.
Question 15.
What will be the order of sorting in the following MySQL statement? [1]
SELECT emp_id, emp_name from Employee order by emp_id, emp_name:
(a) Sorting {emp_id, emp_name}
(b) Sorting {emp_name, emp_id}
(c) Sorting {emp_id} but not emp_name
(d) None of these
Answer:
(a) Sorting {emp_id, emp_name}
Question 16.
Which SQL function will give ‘MAHAL’ as output in the following query? [1]
SELECT(UPPER( ________("Taj Mahal", 5));
(a) INSTR
(b) STRING
(c) MID
(d) SUB
Answer:
(c) MID
Directions (Q.Nos. 17-18) Assertion and Reason based Questions.
Question 17.
Assertion (A) Star topology is a network layout in which all devices are connected to a central hub or switch. [1]
Reason (R) The central hub acts as a central point of communication and controls the flow of data between devices.
(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 and R is true.
Answer:
(a) Both A and R are true and R is the correct explanation for A.
Question 18.
Assertion (A) Sorting is the operation to arrange data in a specific order, sort_values() function used to perform the operation.
Reason (R) Row wise sorting cannot be performed in Python DataFrame objects.
(a) Both A and R are true and R is the correct explanation of A.
(b) Both A and R are true and R is not the correct explanation of R.
(c) A is true but R is false.
(d) Both A and R are false.
Answer:
(c) A is true but R is false.
Section – B
Question 19.
What do you mean by network topology? Write different types of topology. [2]
Or
Mr. Chandervardhan is not able to identify the domain name in the given URL. Identify and write it for him. Also, explain what is URL?
Answer:
A network topology is the arrangement with which computer systems or network devices are connected to each other. Topologies may define both physical and logical aspect of the network. Both logical and physical topologies could be same or different in a same network.
There are different types of topology, which are as BUS, STAR, TREE, MESH.
Or
Domain in is “www.cbsenic.in”. URL is the uniform resource locator which identifies address of each webpage on the www.
Question 20.
Which SQL function is used to remove leading and trailing spaces from a character expression X, where X = ‘LEARNING ###MYSQL####’(# denotes a blank space) and also give the output of X. [2]
Answer:
TRIM function is used to remove all leading and trailing spaces from the given character expression.
Syntax
TRIM([{BOTH|LEADING|TRAILING} [remstr] FROM] str/col umn_name)
e.g.
mysql > SELECT TRIMC LEARNING ###MYSQL###');
Output
LEARNING##MYSQL
Spaces between ‘LEARNING’ and ‘MYSQL’ cannot be removed.
Question 21.
Which type of MySQL function accepts only numeric values? Give the name of some functions of that type. [2]
Answer:
Mathematical functions accept only numeric values and return the value of same type. These functions are used to perform mathematical operations on the database data.
Some mathematical functions are POW()/POWER(), ROUND(), etc.
Question 22.
The Python code written below has syntactical errors. Rewrite the correct code and underline the corrections made. [2]
import pandas as pd data1 = {ID [1, 2, 3], Name [Riya, Preeti, Neeta]} data2 = {ID [4, 5, 6], Name [Siya, Pratik, Neeraj]} df1 = pd.DataFrame(data1) df2 = pd.DataFrame(data2) result = pd.concat(df1, df2) print( )
Answer:
import pandas as pd datal = {'ID': [1, 2, 3], 'Name': [‘Riya’, 'Preeti', 'Neeta']) data2 = ('ID': [4, 5, 6], 'Name': ['Siya', ‘Pratik', 'Neeraj']) df1 = pd.DataFrame(data1) df2 = pd.DataFrame(data2) result = pd.concat([df1, df2]) print(result)
Question 23.
What do you mean by spyware? [2]
Answer:
Spyware is a type of malware that is installed on a computer without the knowledge of the owner in order to collect the owner’s private information. Spyware is often hidden from the user in order to gather information about Internet interaction, keystrokes, passwords and other valuable data.
Question 24.
Given a DataFrame created as: [2]
import pandas as p Stud=p.Series({'Name’ :[‘Ria’, 'Priya', 'Jack'], ‘Eco’ :[56, 61, 89], ‘IP’ :[90, 87, 45], ‘Eng’ :[58, 78, 32])) Studdf=p.Data Frame( Stud) print(Studdf[0:2])
What will be the output of the above code?
Answer:
When a range is specified while printing a DataFrame, it prints from start index to endindex -1. Given code prints rows 0,1.
Name [Ria, Priya, Jack] Eco [56, 67, 89]
Question 25.
Complete the given Python code to calculate the mean value of the ‘price’ column in the DataFrame ‘df’. [2]
import _______ as pd df = pd.DataFrame({’item: [‘A', 'B', ‘C’, ‘D’], ‘price’: [50, 30, 45, 20]}) mean_price = df[’price’]. _____() print(mean_price)
Answer:
import pandas as pd df = pd.DataFrame({'item': ['A', 'B', 'C', 'D'], 'price': [50, 30, 45, 20]}) mean_price = df['price'].mean( ) print(mean_price)
Section – C
Question 26.
Mr. Manav, a database administrator in “Global Educational and Training Institute” has created following table named “Training” for the upcoming training schedule: [3]
Table : Training
Predict the output of the following queries:
(i) SELECT SUBSTR(City, 2, 4) FROM Training WHERE Topic != ’Cyber Security’:
(ii) SELECT NAME FROM Training WHERE INSTR (Email_Id, ‘@’)=0;
(iii) SELECT Topic , C0UNT( ) FROM Training GROUP BY Topic;
Or
Shanya Kumar is working with the following table Customers:
Table: Customers
CNO | CNAME | CITIES |
C1 | SANYAM | DELHI |
C2 | SHRUTI | DELHI |
C3 | MEHER | MUMBAI |
C4 | SAKSHI | CHENNAI |
C5 | RITESH | INDORE |
C6 | RAHUL | DELHI |
C7 | AMEER | CHENNAI |
C8 | MINAKSHI | BANGLORE |
C9 | ANSHUL | MUMBAI |
Write the queries for the following:
(i) To display the city names in lower case letter whose CNO is either C5 or C9.
(ii) To display the length of Customer’s name for those Customers whose NAME end with R or L.
(iii) To display the Customer’s name and their respective CITIES merged together for all the Customers whose CNO is ending with 8.
Answer:
Or
(i) mysql>SELECT LOWER(CITJES)FROM Customers WHERE CNO =‘C5′ OR CNO ‘C9’;
(ii) mysql>SELECT LENGTH(CNAME)FROM Customers WHERE CNAME LIKE %R’ OR CNAME LIKE ‘%L’:
(iii) mysql >SELECT CONCATtCNAME, CITIES) FROM Customers WHERE CNO LIKE
Question 27.
Year | Month | Passengers | |
0 | 2010 | Jan | 25 |
1 | 2010 | Mar | 50 |
2 | 2012 | Jan | 35 |
3 | 2010 | Dec | 55 |
4 | 2012 | Dec | 65 |
Write the code to create the above DataFrame:
Answer:
import pandas as pd data={"Year":[2010, 2010, 2012, 2010, 2012],"Month":["Jan", "Mar", "Jan", "Dec", "Dec"], "Passengers":[25.50.35,55.65]} df=pd.DataFrame(data) print(df)
Question 28.
Consider the following DataFrame df : [3]
Code | Name | Price | Qty | Discount | |
0 | C1 | ABC | 5500 | 10 | 10 |
1 | C2 | XYZ | 4500 | 8 | 5 |
2 | C3 | PQR | 5200 | 12 | 8 |
3 | C4 | MNO | 3000 | 9 | 15 |
4 | C5 | LMN | 5500 | 11 | 12 |
(i) Write down the command that will give the following output.
Code | C1 |
Name | ABC |
Price | 3000 |
Qty | 8 |
Discount | 5 |
dtype : object |
(ii) Find the most repeat value of a given set of number of DataFrame.
(iii) To sort the index label of DataFrame df in descending order.
Answer:
(i)
print(df.min (axis=1))
(ii)
print(df.model))
(iii)
print(df.sort_index(ascending=False))
Question 29.
Abhishek uses computer and mobile for his personal use. Study the following cases and answer the questions given below. [3]
(a) Once he got the message in Whatsapp that CBSE is announcing the result of class XII tomorrow at 12:00 pm. He forwarded the message to his few friends. But later, he came to know that no such announcement was there in CBSE official website. In this case, he violated ………….
(b) He is getting abuse messages from an unknown number due to which he is thinking of quarreling with that person. The unknown person can be called as …………..
(c) He registered himself in one website by giving his email id and phone number he is leaving ………..
Or
Write some symptoms of a malware attack.
Answer:
(a) Communication etiquettes
(b) Internet troll
(c) Digital footprints
Or
Some primary indications of a malware attack are :
- A program disappears from that computer even though you did not intentionally remove the program.
- An antivirus program cannot be installed on the computer, or the antivirus program will not run.
- You see unusual error messages.
- You cannot print items correctly.
Question 30.
Write an SQL command to create the table BANK whose structure is given below [3]
FieldName | Data_type | Size | Constraint |
ID_Number | integer | 10 | Primary key |
Name | varchar | 20 | |
B_Date | date | ||
Address | varchar | 50 |
Answer:
The SQL command to create a table as per given structure is as follows
mysql > CREATE TABLE BANK (ID_Number integer (10) PRIMARY KEY, Name varchar (20), B_Date date, Address varchar (50));
Section – D
Question 31.
Consider the following table named “Product”, showing details of products being sold in a grocery shop. [4]
Table: Product
PCode | PName | UPrice | Manufacture |
P01 | Washing Powder | 120 | Surf |
P02 | Tooth Paste | 54 | Colgate |
P03 | Soap | 25 | Lux |
P04 | Tooth Paste | 65 | Pepsodent |
P05 | Soap | 38 | Dove |
P06 | Shampoo | 245 | Dove |
Write SQL queries for the following and output(s) produced by executing the following queries on the basis of the information given above in the table Product.
(i) Create the table Product with appropriate data types and constraints.
(ii) Identify the PRIMARY KEY in table Product.
(iii) List the Product Code, product Name and Price in with their Product Name for all Dove Manufacture.
(iv) Increase the Price by 12 percent for all the products manufactured by Dove.
Answer:
(i)
CREATE TABLE Product( PCode char(3) PRIMARY KEY, PName varchar(25) NOT NULL, UPrice int(4), Manufacture varchar(30));
(ii) PCode
(iii)
SELECT PCode, PName, UPrice FROM Product WHERE Manufacture=”Dove";
(iv)
UPDATE Product SET UPrice =UPrice+0.12*UPrice WHERE Manufacture="Dove";
Question 32.
Mr. Krishnamurthy, who is a new user of Python Pandas, has created the following Series “Electrical” carrying names of electrical appliances as values and their wattage as the index. He wants to perform certain operations on the Series. You are supposed to help him in writing the commands: [4]
Electrical
Index | Name |
12W | LED |
200W | Fan |
1000W | Electric Iron |
1200W | Rice Cooker |
(i) He wants to change the index of Electrical series “LED” element to “A”.
(ii) To display the record of ‘Fan”.
(iii) Remove dataset with index 1000 W.
Or
(Option for part (iii) only)
Display the last rows of the dataset.
Answer:
(i) Electrical=Electrical.rename(index={‘12W’: “A”})
(ii) Electrical [Electrical==“Fan”]
(iii)
del Electrical ["1000 W"]
Or
print([Electrical[-1:])
Section – E
Question 33.
Consider the following table Graduate and write SQL commands for (i) to (v).
Table : Graduate
(i) List the Names of those students who obtained Div 1.
(ii) Display a report, listing Name, Stipend, Subject and amount of stipend received in a year assuming that the Stipend is paid every month.
(iii) Display first three characters of student Name where/whose SNo is 7.
(iv) Display the student Names having 2nd division.
(v) Display division wise Name of students in alphabetical order.
Or
Write SQL queries for the questions from (i) to (v) on the basis of table Class.
No | Name | Stipend | Subject | AvgMark | Grade |
01 | Vikas | 1200 | Medical | 67 | B |
02 | Boby | 1400 | Humanities | 78.4 | B |
03 | Tarun | 1000 | Medical | 64.8 | C |
04 | Varun | 1600 | Non-medical | 84 | A |
05 | Atul | 1800 | Non-medical | 92 | A |
(i) Select all the non-medical stream students from the table Class.
(ii) Arrange the records of Class name wise.
(iii) List the records whose grade is B or C.
(iv) Insert the new row with the following data. (06, ‘Jack’, 2800, ’Humanities’, 98, ‘A’)
(v) Identify the attribute to be best suitable for primary key.
Answer:
(i) SELECT Name FROM Graduate WHERE Div=1;
(ii) SELECT Name, Stipend, Subject, Stipend *12 FROM Graduate;
(iii) SELECT LEFT(NAME,3)FROM Graduate WHERE SN0=7;
(iv) SELECT NAME FORM Graduate WHERE Div=2;
(v) SELECT Div, Name FROM Graduate GROUP BY Div ORDER BY Name;
Or
- SELECT * FROM Class WHERE Subject= ‘Non-medical’;
- SELECT * FROM Class ORDER BY Name;
- SELECT * FROM Class WHERE Grade IN (‘B’, ‘C’);
- INSERT INTO Class VALUES (06, ‘Jack’, 2800, ‘Humanities’, 98, ‘A’)
- No
Question 34.
A company in Mega Enterprises has 4 wings of buildings as shown in the diagram : [5]
Centre to centre distances between various buildings:
W3 to W1 | 50 m |
W1 to W2 | 60 m |
W2 to W4 | 25 m |
W4toW3 | 170 m |
W3 to W2 | 125 m |
W1 to W4 | 90 m |
Number of computers in each of the wing:
Computers in each wing are networked but wings are not networked. The company has now decided to connect the wings also.
(i) Suggest a most suitable cable layout for the above connections.
(ii) Suggest the most appropriate topology of the connection between the wings.
(iii) Suggest the placement of the following devices with justification, if the company wants minimised network traffic.
(a) Repeater
(b) Hub/Switch
(iv) Expand the following terms:
(a) HTTP
(b) TCP/IP
(v) Suggest the suitable wing to house the server.
Answer:
(i) Most suitable layout according to distance is :
(ii) Star topology
(iii) (a) Repeaters may be skipped as per above layout (because distance is less than 100 m).
(b) In every wing
(iv)
(a) Hyper Text Transfer Protocol.
(b) Transmission Control Protocol/Internet Protocol
(v) Wing W1 is best to house the server because it has maximum number of computers.
Question 35.
Consider the following graph. Write the code to plot it. [5]
Or
Draw the following bar graph representing the quantity of items in each month.
Answer:
from matplotlib import pyplot as plt
x=[1, 2, 4, 6] y= [10, 40, 20, 70] plt.plot(x, y) plt.title("Line graph") plt.ylabel('Y axis') plt.xlabel('X axis') plt.show( )
Or
from matplotlib import .pyplot as pit x=[’I’, 'II', ’III', 'IV','V', 'VI', 'VII'] y=[10, 50, 70, 60, 20, 50, 10] plt.bar(x, y) plt.title("Line graph") plt.ylabel(’Y axis') plt. xlabel ('X axis') plt.show( )