Students can access the CBSE Sample Papers for Class 12 Computer Science with Solutions and marking scheme Term 2 Set 4 will help students in understanding the difficulty level of the exam.
CBSE Sample Papers for Class 12 Computer Science Term 2 Set 4 with Solutions
Maximum Marks: 35
Time: 2 hours
Instructions:
- The question paper is divided into 3 sections – A, B and C.
- Section A, consists of 7 questions (1-7). Each question carries 2 marks.
- Section B, consists of 3 questions (8-10). Each question carries 3 marks.
- Section C, consists of 3 questions (11-13). Each question carries 4 marks.
- Internal choices have been given for question numbers 7, 8 and 12.
Section – A
(Each question carries 2 Marks)
Question 1.
Define the following terms with respect to stack
(i) Stack Top
Answer:
Stack Top The top of the stack is the last element of the stack, which is present at the top most position on the pile.
(ii) Stack Underflow
Answer:
Stack Underflow It happens in a delete operation. We can delete elements from a stack until it is empty, i.e. there is no element in it. Trying to delete an element from empty stack results in an exception called ‘underflow’.
Question 2.
(i) Expand the following
(a) WLAN
Answer:
WLAN → Wireless Local Area Network
(b) DNS
Answer:
DNS → Domain Name System
(ii) Name the three parts of optical fibre cable.
Answer:
Core, Cladding, Protective coating
Question 3.
Write the use of LIKE clause and a short explanation on the two characters used with it.
Answer:
This operator is used to search a specified pattern in a column. It is useful when you want to search rows to match a specific pattern or when you do not know the entire value.The SQL LIKE clause is used to compare a value to similar values using wildcard characters.
We describe patterns by using two special wildcard characters, given below
- The per cent sign (%) is used to match any substring.
- The underscore (_) is used to match any single character.
The symbols can also be used in combinations.
Question 4.
Consider the table Faculty whose columns’ name are F_ID, Name, Hiredate, Salary
Write the code using Python to insert the following record into the above table in MySQL. 101 RiyaSharma 12-10-2004 35000
Answer:
import mysql.connector mycon = mysql .connector.connect (host=“localhost”, user=“root”, passwd=‘‘system”, database=“Test”) cursor = mycon.cursor ( ) sql = “INSERT INTO FACULTY (F_ID, Name, Hiredate, Salary) VALUES (%s, %‘s, %s, %s)” val = [(101, “Riya Sharma”, “12-10-2004”, 35000)] try: cursor.executemany (sql, val) mycon.commit ( ) except: mycon.rol1 back ( ) mycon.close ( )
Question 5.
Write the output for SQL queries based on table CARDEN.
Table: CARDEN
(i) SELECT COUNT (DISTINCT Manufacturer) FROM CARDEN;
Answer:
(ii) SELECT COUNT (*) Manufacturer FROM CARDEN;
Answer:
(iii) SELECT CarName FROM CARDEN WHERE Capacity = 4;
Answer:
(iv) SELECT Code, Manufacturer FROM CARDEN WHERE Color = “White”;
Answer:
Question 6.
(i) Which command is used to select data from a database or view table information?
Answer:
SELECT
(ii) Give the syntax to insert a new row in a table.
Answer:
INSERT INTO table_name (Columnl, Column2, Column3, …)
VALUES. (Value1, Value2, Value3, …);
Question 7.
Consider the following table PAYMENTS
Table PAYMENTS
(i) Identify the degree and cardinality of the table.
(ii) Choose the suitable column which acts as primary key.
Or
(i) Identify the candidate key(s) from table PAYMENTS.
(ii) Which field will act as foreign key when another table DEPT has columns Department, DName.
Answer:
(i) Degree: 4
(ii) Empld Cardinality: 6
Or
(i) Empld, Emp_Name
(ii) Department
Section – B
(Each question carries 3 Marks)
Question 8.
Evaluate following postfix expression. Show the status of stack after execution of each operation.
3, 10, 4, +, *, 4, 3, *, –
Or
Sohan has a list containing 8 integers as marks of subject Science. You need to help him to create a program with separate user-defined function to perform the following operations based on the list.
- Push those marks into a stack which are greater than 75.
- Pop and display the content of the stack.
Simple Input
Marks = [75, 80, 56, 90, 45, 62, 76, 72]
Sample Output
80 90 76
Answer:
Given postfix expression is 3, 10, 4, +, *, 4, 3, *, –
Or
Marks = [75, 80, 56, 90, 45, 62, 76, 72] def PUSH (St, Marks): St. append(Marks) def POP(St): if St ! = [ ]: return St. pop ( ) else; return None Stack1 = [ ] for x in Marks: if x > 75 : PUSH (Stackl, x) while True: if Stack1! = [ ]: print (POP(Stackl), end = " ") else: break
Question 9.
(i) A table PERSONS has following fields P_Id, FirstName, LastName, Address, City
Give the SQL command to display the FirstName that start with letter “T”.
Answer:
SELECT FirstName FROM PERSONS WHERE FirstName LIKE “T%”;
(ii) Rakesh wants to increase the price of some of the products by 20%, of his store whose price is less than 200. Assuming the following structure, what will be the query?
Answer:
UPDATE ITEM SET Price=Price + Price * 0.2 WHERE Price<200 ;
The UPDATE command updates data of a table. While updating, the expression for update value can be assigned to the updating field. The records to be updated can be specified as WHERE condition.
Question 10.
Sanjeev has created a database named LIBRARY in MySQL.
He now needs to create a table name BOOKS in the database to store the records of various books.
The table BOOKS has the following structure.
Table: BOOKS
Field Name | Datatype | Remark |
Book_Id | Varchar (5) | Primary Key |
Book_Name | Char (20) | |
Author_Name | Char (20) | |
Publishers | Char (20) | |
Price | Integer | |
Type | Char (10) | |
Qty | Integer |
Help him to complete the task by suggesting SQL commands.
Answer:
CREATE DATABASE LIBRARY;
CREATE TABLE BOOKS
(Book_Id Varchar (5) Primary Key, Book_Name Char (20),
Author_Name Char (20),
Publishers Char (20),
Price Integer,
Type Char (10),
Qty Integer);
Section – C
(Each question carries A Marks)
Question 11.
Write queries (i) to (iv) based on the table Teacher and Posting given below
Table : Teacher
Table: Posting
P_ID | Department | Place |
1 | History | Agra |
2 | English | Raipur |
3 | Mathematics | Delhi |
4 | CQmputer Science | Meerut |
(i) To list the names of female teachers who are in Mathematics department.
Answer:
SELECT Name FROM Teacher WHERE Department = “Mathematics” AND Gender= “F”;
(ii) To display teacher’s name, salary, age for male teachers only.
Answer:
SELECT Name, Salary, Age FROM Teacher WHERE Gender = “M”;
(iii) To display name, bonus for each teacher where bonus is 10% of salary.
Answer:
SELECT Name, Salary * 0.1 AS Bonus FROM Teacher;
(iv) To display Name, Department of teachers who are in Delhi.
Answer:
SELECT Name, Department FROM Teacher T, Posting P WHERE T. Department = P. Department AND PI ace = “Del hi”;
Question 12.
(i) Define in brief POP and SMTP protocols used for E-mail.
Or
What kind of communication channels is required for establishing the connection between TV channels?
Answer:
Post Office Protocol (POP) It is a
computer networking protocol used as Internet standard protocol. POP extracts and retrieves email from a remote mail server for access by the’host machine. It is an application layer protocol that provides end users an ability to fetch and receive email. The most recent version of POP protocol is used in POP3.
Simple Mail Transfer Protocol (SMTP) It is a set of commands that are required for sending and receiving of the email. The email sender uses SMTP to send an email to the mail server and further, mail server uses SMTP to forward that received mail to the receiver mail server.
Or
For establishing the connection between TV channels we require satellite communication. Satellites are an essential part of telecommunication systems. They carry a large amount of data in addition to TV signals. When the data is transmitted using satellite then it is said to be satellite communication. A satellite communication consists of an earth station and a satellite at a stationary orbit, which is about 22300 miles above the earth’s surface. A satellite communication is a space station that receives microwave signals from an earth-based station, amplifies the signals and broadcasts the signals back over a wide area to any number of earth-based stations.
(ii) What do you mean by an architecture of a network? Explain in brief Peer-to-Peer network.
Answer:
- Logical and structural layout of a network is called as network architecture, which consists of networking equipment, protocols and infrastructure. There are two types of network architecture – Peer-to-Peer and client server using different techniques.
- Peer-to-Peer (P2P) It is a connection between two nodes of the network. One sender can send message to exactly one receiver and vice-versa. Sending and receiving of data can be done using different channels or same channel turn by turn.
Question 13.
Tech Up Corporation (TUC) is a professional consultancy company. The company is planning to set up their new offices in India with its hub at Hyderabad. As a network adviser, you have to understand their requirement and suggest to them the best available solutions. Their queries are mentioned as (i) to (iv) below.
Block to block distances (in metre)
Block (From) | Block (To) | Distance |
Human Resource | Conference | 60 |
Human Resource | Finance | 120 |
Conference | Finance | 80 |
Expected number of computers to be installed in each block
Block | Computers |
Human Resource | 125 |
Finance | 25 |
Conference | 60 |
(i) What will the most appropriate block, where TUC should plan to install their server?
Answer:
TUC should install its server in Human Resource Block as it has maximum number of computers.
(ii) Draw a block to block cable layout to connect all the buildings in the most appropriate manner for efficient communication.
Answer:
The above layout is based on the minimum length of cable required, i.e. 140 m.
(iii) What will be the best possible connectivity out of the following, you will suggest to connect the new setup of offices in Bengalore with its London based office?
(a) Infrared
(b) Satellite link
(c) Ethernet cable
Answer:
(b) Satellite link
(iv) Company is planning to connect its Block in Hyderabad which is more than 20 km. Which type of network will be formed?
Answer:
MAN