Students must start practicing the questions from CBSE Sample Papers for Class 12 Informatics Practices with Solutions Set 4 are designed as per the revised syllabus.
CBSE Sample Papers for Class 12 Informatics Practices Set 4 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 _____ is a network device that connects multiple devices together, allowing them to communicate with each other. [1]
(a) modem
(b) hub
(c) switch
(d) router
Answer:
(b) hub
Question 2.
Linux, MySQL and Mozilla Firefox software come under category. [1]
(a) proprietary
(b) FOSS
(c) freeware
(d) shareware
Answer:
(b) FOSS (Free and Open Source Software)
Question 3.
Type(s) of law that can help to restrict software piracy is/are
(a) copyright
(b) paten :
(c) trademark
(d) All of these
Answer:
(d) All of these
Question 4.
The return type of POWER( ) function is
(a) String
(b) Date
(c) Numeric
(d) None of these
Answer:
(c) Numeric
Question 5.
The correct output of
SELECT TRIM (LEADING FHOM ‘&&& India &&&&’); is
(a) India &&&
(b) Indie &&&&
(c) && India
(d) &&& India
Answer:
(b) India &&&&
Question 6.
Which of the following import statement is not correct? [1]
(a) import pandas class 12
(b) import pandas as 1pd
(c) import pandas as pd1
(d) import pandas as pd
Answer:
(b) import pandas as 1 pd
Question 7.
Which of the following as an example of copyleft license? [1]
(a) GPL
(b) BSD
(c) MIT
(d) All of these
Answer:
(a) GPL
Question 8.
For given table ‘emp’ with following columns
eno, ename, sal, dept, designation
Select correct statement to display all records of ‘emp’ in descending order of ename and within ascending order of dept. [1]
(a) SELECT*FROM emp ORDER BY ename, dept DESC;
(b) SELECT*FROM emp ORDER BY ename, ORDER BY dept DESC;
(c) SELECT*FROM emp ORDER BY ename DESC, dept;
(d) SELECT*FROM emp WHERE ORDER BY ename, dept DESC;
Answer:
(c) SELECT*FROM emp ORDER BY ename DESC, dept;
Question 9.
Which of the following is/are library function(s) used to load data from CSV files into DataFrame? [1]
(a) read_csv()
(b) to_csv()
(c) Both (a) and (b)
(d) None of these
Answer:
(c) Both (a) and (b)
Question 10.
What will be returned by the given query?
SELECT ROUND(153.669,2); [1]
(a) 153.6
(b) 153.66
(c) 153.67
(d) 153.7
Answer:
(c) 153.67
Question 11.
Given a Pandas Series called Sequences, the command which will display the first 4 rows is ______ [1]
(a) print(Sequences.head(4))
(b) print(Sequences.Head (4))
(c) print(Sequences.heads(4))
(d) print(Sequences.Heads (4))
Answer:
(a) print(Sequences.head(4))
Question 12.
Which amongst the following is not a Text function in MySQL? [1]
(a) UCASEO
(b) RIGHTO
(c) DAY()
(d) LENGTH()
Answer:
(c) DAYO
Question 13.
______ topology, network components are connected to the same cable. [1]
(a) Star
(b) Ring
(c) Bus
(d) Mesh
Answer:
(c) Bus
Question 14.
In files, there is a key associated with each record which is used to differentiate among different records. For every file, there is atleast one set of keys that is unique. Such key is called [1]
(a) Unique key
(b) Prime attribute
(c) Index key
(d) Primary key
Answer:
(d) Primary key
Question 15.
The digital data trail we leave online intentionally is called [1]
(a) Active digital footprints
(b) Passive digital footprints
(c) Current digital footprints
(d) None of these
Answer:
(a) Active digital footprints
Question 16.
The ____ include right to copy (reproduce) a work, right t0 distribute copies of the work to the public, and right to publicly display or perform the work. [1]
(a) Copyright
(b) Patent
(c) Create right
(d) None of these
Answer:
(a) Copyright
Directions (Q.Nos. 17-18) Assertion and Reason based Questions.
Question 17.
Assertion (A) Pandas is an open-source Python library which offers high performance, easy to use data structures and data analysis tools. [1]
Reason (R) Professionals and developers are using the Pandas library in data science and machine learning.
(a) Both A and R are true and R is the correct explanation of A
(b) Both A and R are true but R is not the correct explanation of A
(c) A is true but R is false.
(d) A is false but R is true.
Answer:
(a) Both A and R are true and R is the correct explanation of A.
Question 18.
Assertion (A) The name Bluetooth is derived from Harald Bluetooth, a king in Denmark. [1]
Reason (R) Bluetooth is used for exchanging data over a short distance from fixed and mobile 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.
Section – B
Question 19.
List some benefits of networking. Name any two components required for networking. [2]
Or
Give an example of each static web page and dynamic web page.
Answer:
Some of the benefits of networking are
- File sharing
- Hardware sharing
- Application sharing
- User communication
- Access to remote database
Two components required for networking are Switch/hub and repeaters.
Or
Static web page A page that contains school or company information. The content of this page will not change every day unless the HTML file is manually edited by a programmer who maintains it.
Dynamic web page When you login to your Yahoo E-mail account to check and to send E-mails. Moreover, the list of E-mail messages changes as it arrives or as the list is deleted or is moved to another folder.
Question 20.
The Python code written below has syntactical errors. Rewrite the correct code and underline the corrections made. [2]
Import pandas as pd Emp = {'a' : 10000, ‘b’ : 15000, 'c’ : 12000} Sr = Pd.Series(Emp) Print(sr)
Answer:
Correct code is:
import pandas as pd Emp = {‘a' : 10000, 'b' : 15000, 'c' : 12000} sr = pd.Series(Emp) print(sr)
Question 21.
A character expression name contains ‘try yourself. Write a command to pick the following set of characters from it. [2]
(i) First 3 characters
(ii) From 3rd to 7th character
Answer:
(i) mysql >SELECT LEFT (‘try yourself’, 3);
(ii) mysql>SELECT SUBSTR (‘try yourself’, 3, 5);
Question 22.
Carefully observe the following code: [2]
import pandas as pd One={'P’:5000,’Q':8000,'R':12000,'S': 18000} Two={'A' :13000,'B':14000,'C':12000} totSales={1:One,2:Two} df=pd.DataFrame(totSales) print(df)
Answer the following:
(i) List the index of the DataFrame df
(ii) List the column names of DataFrame df.
Answer:
(i) The index labels of df will include R Q, R, S, A, B, C.
(ii) The column names of DataFrame df will be 1,2.
Question 23.
List some factors which have led in rise of cyber crimes? [2]
Answer:
Some factors which have led in rise of cyber crimes are as follows
(i) Spread of computers
(ii) Increasing use to broadband
(iii) Increasing financial motivation for computer crime
Question 24.
Complete the given Python code to get the required output as: 16 [2]
Import ____ as np data = [1, 4, 9, 16] series_data = np.____(data) print (series_data [____])
Answer:
Correct code is:
import numpy as np data = [1, 4, 9, 16] series_data = np.array(data) print(series_data[3])
Question 25.
What is the purpose of ORDER BY clause in SQL? Explain with the help of suitable example. [2]
Answer:
The ORDER BY clause is used to sort the result set in ascending or descending order, e.g. The following SQL statement displays all the customer’s names in alphabetical order.
SELECT Cname FROM Customers ORDER BY Cname;
Section – C
Question 26.
Rahul has recently shifted to a new college and hostel. He does not know many people in his new college and hostel. But all of a sudden, someone is posting negative, demeaning comments on his social networking profile etc.
He is also getting repeated mails from unknown people. Every time he goes online, he finds someone chasing him online. [3]
(i) What is this happening to Rahul?
(ii) What immediate action should he take to handle it?
(iii) Is there any law in India to handle such issues? Discuss briefly.
Or
What is software licensing ? Name two types of software licensing with an example of each.
Answer:
(i) Rahul has become a victim of cyber bullying and cyber stalking.
(ii) He must immediately bring it into the notice of his parents and school authorities. And he must report this cyber crime to local police with the help of his parents.
(iii) Yes. The Information Technology Act, 2000 (also known as ITA-2000, or the IT Act) is the primary law in India dealing with cybercrime and electronic commerce.
Or
A software license is a license agreement that given an individual, a company or an organisation permission to use a software program. It typically provides end users with the right to one or more copies of the software without violating copyrights. Software licenses typically are the either proprietary or free and open source.
- Proprietary software Microsoft Windows.
- Free and open source software license MySQL, Python
Question 27.
Write a small Python code to create a DataFrame with headings (a and b) from the list given below [3]
[[10, 20], [30, 40], [50, 60], [70, 80]]
Answer:
import pandas as pd df1=pd.DataFrame ([[10, 20], [30, 40]], columns = [‘a’, ‘b’]) df2=pd.DataFrame ([[50, 60], [70, 80]], columns = [‘a’,‘b’]) df = df1.append (df2)
Question 28.
Given a DataFrame df as shown below [3]
A | B | C | |
0 | 21 | 12 | 69 |
1 | 45 | 45 | 84 |
2 | 23 | 86 | 70 |
3 | 17 | 33 | 78 |
What will be the result of the following code statements?
(i) df[ ‘D’ ]=np.NaN
(ii) df [ ‘ D’ ] = [23, 41, 32]
(iii) df [‘D’ ] = [23, 41, 32, 9]
Answer:
(i)
A | B | D | |
0 | 21 | 12 | NaN |
1 | 45 | 45 | NaN |
2 | 23 | 86 | NaN |
3 | 17 | 33 | NaN |
(ii) ValueError Length of values does not match with the length of index.
(iii)
A | B | D | |
0 | 21 | 69 | 23 |
1 | 45 | 84 | 41 |
2 | 23 | 70 | 32 |
3 | 17 | 78 | 9 |
Question 29.
Consider the table EXAM given below. Write the queries for (i) to (iii). [3]
(i) To list the names of those students, who have obtained division as 1st in ascending order of Name.
(ii) To count the number of students, who have either Accounts or Informatics as Subject.
(iii) To display a report listing Name, Subject and annual Stipend received assuming that the Stipend column has monthly stipend.
Or
Reena is working with functions of MySQL.
Explain her following
(i) What is the purpose of NOW( ) function?
(ii) How many parameters does it accept?
(iii) What is the general format of its return type?
Answer:
(i) SELECT Name FROM EXAM WHERE Division = “1st” ORDER BY Name;
(ii) SELECT COUNT (*) FROM EXAM WHERE Subject = “Accounts” OR Subject = “Informatics”:
(iii) SELECT Name, Subject, Stipend * 12 “Stipend” FROM Exam; .
Or
(i) The NOW( ) function returns the current date and time.
(ii) 0 parameters
(iii) “YYYY-MM-DD HH-MM-SS”
Question 30.
Give the output of following commands. [3]
(i) mysql > SELECT TRUNCATE (200.91, 1);
(ii) mysql > SELECT LEFT (‘Swati ’, 4);
(iii) mysql >SELECT LENGTH (“Information”);
Answer:
(i) 200.9
(ii) Swat
(iii) 11
Section – D
Question 31.
Tejasvi Sethi, a car dealer has stored the details of all cars in her showroom in a table CARMARKET. The table CARMARKET has attributes CARCODE which is a primary key, CARNAME, COMPANY, COLOR, COST (in lakh) of the car and DOM which is the Date of Manufacture of the car. [4]
Help her by writing answers of the following questions based on the given table.
(i) Display the camame along with the charges rounded off to 1 digit after decimal place.
(ii) Display the camame.name of the company in lower case of all cars whose year (of dom) is 2020.
(iii) Display the number of cars manufactured each year.
(iv) Display the camame, color and position of the character ‘E’ in the color of all the cars.
Answer:
(i) SELECT CARNAME, ROUND(COST, 1) FROM CARMARKET;
(ii) SELECT CARNAME, LCASE(COMPANY) FROM CARMARKET WHEIEE YEAR (DOM) = 2020;
(iii) SELECT C0UNT(*), YEAR(DOM) FROM CARMARKET GROUP BY YEAR(DOM);
(iv) SELECT CARNAME, COLOR, INSTR(COLOR, ’E’) FROM CARMARKET;
Question 32.
Mr. Ankit is working in an organisation as data analyst. He uses Python Pandas and Matplotlib for the same. He got a dataset of the passengers for the year 2010 to 2012 for January, March and December. His manager wants certain information from him, but he is facing some problems.
Help him by answering few questions given below: [4]
Table: CARMARKET
Year | Month | Passengers | |
0 | 2010 | Jan | 25 |
1 | 2010 | Mar | 50 |
2 | 2012 | Jan | 35 |
3 | 2010 | Dec | 55 |
4 | 2012 | Dec | 65 |
(i) What will be the output of the following statements?
(a) df.shape( )
(b) df.index=[“Airlndia”,“Indigo”,“Spicejet”,“Jet”,“Emi rates”]
(ii) Write the code to get the following output;
Month | Passengers | |
0 | Jan | 25 |
2 | Jan | 35 |
(iii) Predict the output of print (df[1 : 3])
Or
(Option for part (iii) only)
Suppose a DataFrame df contains information about student having columns rollno, name, class and section. Write the code to transpose DataFrame.
Answer:.
(i) (a) (5, 3)
(b)
Year | Month | Passengers | |
Air India | 2010 | Jan | 25 |
Indigo | 2010 | Mar | 50 |
Spicejet | 2012 | Jan | 35 |
Jet | 2010 | Dec | 55 |
Emirates | 2012 | Dec | 65 |
(ii) df[[‘Month’,‘Passengers’]][df[‘Month’] ==‘Jan’]
Year | Month | Passengers | |
1 | 2010 | Mar | 50 |
2 | 2012 | Jan | 35 |
Or
df.T
Section – E
Question 33.
Write down the syntax format of the following functions, with one example of each. [5]
(i) LCASE(str)
(ii) UCASE(str)
(iii) RIGHT(str,n)
(iv) POWER(m,n)
(v) RTRIM(str)
Or
Consider the table DOCTOR given below. Write commands in SQL for (i) to (iv) and answer the question for (v).
(i) Display the names and salaries of doctors in descending order of salaries.
(ii) Display names of each department along with total salary being given to doctors of that department.
(iii) Display the number of doctors in each department.
(iv) To display all the female doctors from the given data.
(v) Identify the primary key from the table DOCTOR.
Answer:
(i) Syntax LCASE (str)
e.g. mysql >SELECT LCASE( ‘MySQL’);
Output MySQL
(ii) Syntax UCASE (str)
e.g. mysql>SELECT UCASE (‘Mystring’);
Output MYSTRING
(iii) Syntax RIGHT (str, n)
e.g. mysql>SELECT RIGHT(’Americ‘, 3);
Output ica
(iv) Syntax POWER (m, n)
e.g. mysql>SELECT POWER(2, 2):
Output 4
(v) Syntax RTRIM (str)
e.g. mysql > SELECT RTRIM(’##Arihant#’);
where # denotes space.
Output ##Arihant
Or
(i) SELECT DOCName, Salary FROM DOCTOR ORDER BY Salary DESC;
(ii) SELECT Department, SUM (Salary) FROM DOCTOR GROUP BY Department;
(iii) SELECT Department, COUNT(*) FROM DOCTOR GROUP BY Department;
(iv) SELECT DOCName FROM DOCTOR WHERE Gender’F’;
(v) ID
Question 34.
Green Valley Public School has 4 buildings in its campus. Distance between the buildings and the number of computers in each is given below [5]
(i) Which building is best suitable for placement of server?
(ii) If building A to D is to be connected, which device will be required for strong signals?
(iii) Which building would need a switch/hub?
(iv) Which topology would you suggest for connecting computers in each building?
(v) Suggest and draw cable layout to efficiently connect various buildings within the school campus for a wired connectivity.
Answer:
(i) Building A, as it has maximum number of computers.
(ii) A repeater would be required, as signals become weak in long distances which can be amplified by a repeater.
(iii) Hub/switch would be required in all the buildings as they connect multiple computers.
(iv) Star topology would be the best as it has multiple positive features.
(v) Cable layout
Question 35.
A bar graph is used to show individual figures at a specific time or to compare different items. Similarly, a bar graph which is showing the marks of different subjects. You have to write the code that will represent the given graph. [5]
Or
Write a Python code to create a line graph for the data given below based on Games apps rated by the users.
Games = ["Subway Surfer","Temple Run","CandyCrush","Bottle Shot","Runner Best"] Rating-[4.2,4.8,5.0,3.8,4.1]
Answer:
import matplotlib.pyplot as pit x = [‘Math’, ‘SST’, ‘Hindi’, ‘Science’, ‘Computer’, ‘English’] marks = [85, 75, 88, 80, 77, 67] x_pos = [i for i, _ in enumerate(x)] plt.xlabe1("Subjects”) plt.ylabe1(“Marks”) plt.title(“Marks of different subjects”) pit.xticks(x_pos, x) width = [0.1, 0.2, 0.5, 1.1, 0.2, 0.3] y_pos = [0, .8, 1.5, 3, 5, 6] plt.bar(y_pos, marks, width=width) plt.xticks(y_pos, x) plt.minorticks_on( ) plt.grid(which=‘major’, linestyle=‘-’, 1inewidth=‘0.5’, color=‘black’) plt.grid(which=‘minor', linestyle=‘ :’, linewidth=‘0.5’, color=‘magenta’) plt.show()
Or
import matplotlib.pyplot as pit Games=[“Subway Surfer”,“Temple Run”,"CandyCrush”,“Bottle Shot”,“Runner Best”] Rating=[4.2, 4.8, 5.0, 3.8, 4.1] plt.plot(Games.Rating) plt.title(Games apps”) plt.xlabe1(“Games”) plt.ylabe1("Rating”) plt.show( )