0% found this document useful (0 votes)
55 views13 pages

Class 12 Computer Science Sample Paper Set 13

The Class 12 Computer Science Sample Paper is a meticulously crafted resource aimed at helping students prepare for their board examinations. It includes a diverse set of questions, such as programming problems, theoretical concepts, and case studies, aligned with the latest CBSE syllabus and exam pattern. Covering essential topics like Python programming, data structures, database management, and computer networks, this sample paper enhances both conceptual understanding and practical skills.

Uploaded by

Artham Resources
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views13 pages

Class 12 Computer Science Sample Paper Set 13

The Class 12 Computer Science Sample Paper is a meticulously crafted resource aimed at helping students prepare for their board examinations. It includes a diverse set of questions, such as programming problems, theoretical concepts, and case studies, aligned with the latest CBSE syllabus and exam pattern. Covering essential topics like Python programming, data structures, database management, and computer networks, this sample paper enhances both conceptual understanding and practical skills.

Uploaded by

Artham Resources
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Dear Teachers and Students,

Join School of Educators' exclusive WhatsApp, Telegram, and Signal groups for FREE access
to a vast range of educational resources designed to help you achieve 100/100 in exams!
Separate groups for teachers and students are available, packed with valuable content to
boost your performance.

Additionally, benefit from expert tips, practical advice, and study hacks designed to enhance
performance in both CBSE exams and competitive entrance tests.

Don’t miss out—join today and take the first step toward academic excellence!

Join the Teachers and Students


Group by Clicking the Link Below
Series ARSP/13 Set ~ 13
Roll No. Q.P Code 15/13/13
Candidates must write the Q.P Code
on the title page of the answer-book.

 Please check that this question paper contains 09 printed pages.


 Q.P. Code given on the right hand side of the question paper should be written
on the title page of the answer-book by the candidate.
 Please check that this question paper contains 37 questions.
 Please write down the serial number of the question in the answer-book
before attempting it.
 15 Minute times has been allotted to read this question paper. The question
paper will be distributed at 10:15 a.m. From 10.15 a.m to 10.30 a.m, the students
will read the question paper only and will not write any answer on the answer –
book during this period.

COMPUTER SCIENCE

Time allowed: 3 hours Maximum Marks: 70


General Instructions:

​This question paper contains 37 questions.

All questions are compulsory. However, internal choices have been provided in some questions. Attempt only one
of the choices in such questions.

The paper is divided into 5 Sections- A, B, C, D and E.

Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.

Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.

Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.

Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.

Section E consists of 2 questions (36 to 37). Each question carries 5 Marks.

All programming questions are to be answered using Python Language only.

In case of MCQ, text of the correct answer should also be written.

Section A
1. State true or false: [1]
The value of the expressions 4/(3*(2-1)) and 4/3*(2-1) is the same.
2. With SQL, how do you select all the records from a table named "Students" where the value of the column [1]
"FirstName" ends with an "a"?

a) SELECT * FROM Students WHERE b) SELECT * FROM Students WHERE


FirstName LIKE '%a' FirstName = '%a%'

c) SELECT * FROM Students WHERE d) SELECT * FROM Students WHERE


FirstName LIKE 'a%' FirstName = 'a'
3. What does the special file called data dictionary contains? [1]

a) The data types of all data in all files. b) The names of all fields in all files.

c) All of these d) The widths of all fields in all files.


4. What is the output of the below program: [1]
def sayHello():
print('Hello World!')
sayHello()
sayHello()
a) Hello b) 'Hello World!'
Hello 'Hello World!'

c) Hello World! d) "Hello"


Hello World! 'Hello'
5. What is the output of the following? [1]
d = {0: 'a', 1: 'b', 2: 'c'}
for x in d.keys():
print (x, " :", d[x], end = '...')
6. What is such a communication system called where data can be sent in both the directions simultaneously? [1]

a) Full duplex b) Half duplex

c) Synchronous d) Asynchronous
7. Which character is used to create a new file in csv? [1]

a) x b) r

c) r+ d) w
8. What is default value of host? [1]

a) localhost b) global host

c) Host d) general host


9. Which of the following is not a sequential datatype in Python? [1]

a) List b) Dictionary

c) Tuple d) String
10. Write a single loop to display all the contents of a text file poem.txt after removing leading and trailing [1]
whitespaces.
11. State true or false: [1]
Non-default arguments can be placed before or after a default argument in a function definition.
12. LIFO stands for [1]

a) First in Last Out b) List of File Outputs

c) Latest in fastest out d) Last in First Out


13. Write a query to display the Sum, Average, Highest and Lowest salary of the employees grouped by department [1]
number.
14. A ________ is a network spread across a small area connecting various related devices such as laptop, mobile [1]
phone, wifi, printers etc.

a) WAN b) MAN

c) PAN d) LAN
15. What is the value of this expression 3**3**1? [1]

a) 3 b) 27

c) 9 d) 1
16. Which of the following operator displays a record if either the first condition or the second condition is true? [1]
a) BETWEEN b) OR

c) AMONG d) AND
17. Protective covering that protects the optical fiber from outside environment is known as [1]

a) Core b) Jacket

c) Buffer d) Cladding
18. Network device which connects networks of similar types (same protocols): [1]

a) Router b) Gateway

c) Hub d) Bridge
19. Assertion (A): Python is a free, open-source programming language [1]
Reason (R): Python is easy to learn as compared to other programming languages.

a) Both A and R are true and R is the correct b) Both A and R are true but R is not the
explanation of A. correct explanation of A.

c) A is true but R is false. d) A is false but R is true.


20. Assertion(A): In Python, the csv.reader() module is used to read the CSV file. [1]
Reason(R): We can also use DictReader() function to read the CSV file directly into a dictionary rather than
deal with a list of individual integer elements.

a) Both A and R are true and R is the correct b) Both A and R are true but R is not the
explanation of A. correct explanation of A.

c) A is true but R is false. d) A is false but R is true.


21. Assertion (A): A function must be defined before the function call. [1]
Reason (R): Python provides the def keyword to define the function.

a) Both A and R are true and R is the correct b) Both A and R are true but R is not the
explanation of A. correct explanation of A.

c) A is true but R is false. d) A is false but R is true.


Section B
22. What are the steps followed in checksum generator? [2]
23. List the most common parameters and the usage that are passed to communicate with the database. [2]
24. What is the advantage of pop() method over a del keyword? [2]
OR
Consider the following code:
string = input ("Enter a string")
count = 3
while True:
if string [0] == 'a':
string = string [2:]
elif string [-1] == 'b' :
string = string [:2]
else:
count += 1
break
print(string)
print(count)
What will be the output produced, if the input is:
i. aabbcc
ii. aaccbb
iii. abcc
25. Which record will get inserted in the table by the following code? [2]
import mysql. connector as sqltor
mycon = sqltor .connect(host = "localhost”, user = "learner”, passwd = "fast”, database=”test")
cursor = mycon.cursor()
query = "INSERT INTO books (title, isbn) VALUES(%s, %s)".% (fUshakaalJ, '12678987036')
cursor.execute(query)
mycon.commitO
26. Write a program which will find all such numbers which are divisible by 7 but are not a multiple of 5, between [2]
200 and 300 (both included).
OR
Explain the types of compile-time errors.
27. Write a function Revstring () to read a textfile "Input.txt" and prints the words starting with 'O' in reverse order. [2]
The rest of the content is displayed normally.
Example:
If content in the text file is:
UBUNTU IS AN OPEN SOURCE OPERATING SYSTEM
Output will be:
UBUNTU IS AN NEPO SOURCE GNITAREPO SYSTEM
(words 'OPEN' and 'OPERATING' are displayed in reverse order)
OR
Write a program that copies a text file "source.txt" onto "target.txt" barring the lines starting with @ sign.
28. Write a function to accept a number and return True if the passed number is even otherwise False. Test it with [2]
two input numbers.
Section C
29. What are different types of arguments/parameters that a function can have? [3]
OR
How are following two statements different?
import math
from math import *
30. For the following SQL Table named PASSENGERS in a database TRAVEL: [3]

TNO NAME START END

T1 RAVI KUMAR DELHI MUMBAI

T2 NISHANT JAIN DELHI KOLKATA

T3 DEEPAK PRAKASH MUMBAI PUNE


A cursor named Cur is created in Python for a connection of a host which contains the database TRAVEL. Write
the output for the execution of the following Python statements for the above SQL Table PASSENGERS:
Cur.execute('USE TRAVEL')
Cur.execute('SELECT * FROM PASSENGERS')
Recs=Cur.fetchall()
for R in Recs:
print(R[1])
OR
Write the names of any two constraints and their respective uses in SQL.
31. Write definition of a method OddSum(NUMBERS) to add those values in the list of NUMBERS, which are not [3]
even.
OR
Write the definition of a function Sum3(L) in Python, which accepts a list L of integers and displays the sum of all
such integers from the list L which end with the digit 3.
For example, if the list L is passed
[123, 10, 13, 15, 23]
then the function should display the sum of 123, 13, 23, i.e. 159 as follows:
Sum of integers ending with digit 3 = 159
Section D
32. Each node of a STACK contains the following information : [4]
i. Pin code of a city,
ii. Name of the city.
Write a program to implement the following operations in the above stack
i. PUSH( ) To push a node into the stack.
ii. POP( ) To remove a node from the stack.
OR
Write a program to implement a stack for these book details (book no., book name). That is, now each item node of
the stack contains two types of information - a book no. and its name. Just implement Push and display operations.
33. A binary file "PATIENTS.dat" has structure (PID, NAME, DISEASE). [4]
Write the definition of a function countrec() in Python that would read contents of the file "PATIENTS.dat"
and display the details of those patients who have the DISEASE as 'COVID-19'. The function should also
display the total number of such patients whose DISEASE is 'COVID-19'.
34. Give output for following SQL queries as per given table(s) : [4]
Table : ITEM

I_ID ItemName Manufacturer Price

PC01 Personal Computer ABC 35000

LC05 Laptop ABC 55000

PC03 Personal Computer XYZ 32000

PC06 Personal Computer COMP 37000

LC03 Laptop PQR 57000


Table : CUSTOMER

C_ID CustomerName City IJD

01 N Roy Delhi LC03

06 H Singh Mumbai PC03

12 R Pandey Delhi PC06

15 C Sharma Delhi LC03

16 K Agarwal Banglore PC01

i. SELECT DISTINCT City FROM Customer ;


ii. SELECT ItemName, MAX(Price), Count(*)
FROM Item GROUP BY ItemName ;
iii. SELECT CustomerName, Manufacturer
FROM Item, Customer
WHERE Item.I_ID = Customer.I_ID ;
iv. SELECT ItemName, Price * 100
FROM Item WHERE Manufacturer = 'ABC';
OR
Write SQL queries for (a) to (d) based on the tables PASSENGER and FLIGHT given below:
Table: PASSENGER

PNO NAME GENDER FNO

1001 Suresh MALE F101

1002 Anita FEMALE F104

1003 Harjas MALE F102

1004 Nita FEMALE F103

Table: FLIGHT

FNO START END F_DATE FARE

F101 MUMBAI CHENNAI 2021-12-25 4500

F102 MUMBAI BENGALURU 2021-11-20 4000

F103 DELHI CHENNAI 2021-12-10 5500

F104 KOLKATA MUMBAI 2021-12-20 4500

F105 DELHI BENGALURU 2021-01-15 5000

a. Write a query to change the fare to 6000 of the flight whose FNO is F104.
b. Write a query to display the total number of MALE and FEMALE PASSENGERS.
c. Write a query to display the NAME, corresponding FARE and F_DATE of all PASSENGERS who have a flight
to START from DELHI.
d. Write a query to delete the records of flights which end at Mumbai.
35. Consider the tables FACULTY and COURSES with structure as follows. [4]
Write Python codes for the following.
i. To display details of these faculties whose salary is greater than 12000
ii. To display the details of courses whose fees is in the range of 15000 to 50,000 (both values included)
iii. To increase the fees of course "System Design" by 500
iv. To display the count of unique F_ID from courses table.
Section E
36. Great Studies University is setting up its Academic schools at Sunder Nagar and planning to set up a network. [5]
The university has 3 academic schools and one administration centre as shown in the diagram below:

Center to center distances between various buildings is as follows:

Law School to Business School 60 m

Law School to Technology School 90 m

Law School to Admin Center 115 m

Business School to Technology School 40 m

Business School to Admin Center 45 m

Technology School to Admin Center 25 m

Number of Computers in each of the Schools/Center is as follows:

Law School 25

Technology School 50

Admin Center 125

Business School 35

i. Suggest the most suitable place (i.e., Schools/Center) to install the server of this university with a suitable
reason.
ii. Suggest the most efficient connecting medium for connecting these Schools/center for wired connectivity.
iii. Which device you will suggest to be placed/installed in each of these Schools! center to efficiently connect
all the computers within these Schools/center?
iv. The university is planning to connect its admission office in the closest big city, which is more than 350 km
from the university. Which type of network out of LAN, MAN or WAN will be formed? Justify your answer.
37. Write SQL queries for (i) to (iv) and find outputs for SQL queries (v) to (viii), which are based on the tables. [5]
TRAINER
TID TNAME CITY HIREDATE SALARY

101 SUNAINA MUMBAI 1998-10-15 90000

102 ANAMIKA DELHI 1994-12-24 80000

103 DEEPTI CHANDIGARH 2001-12-21 82000

104 MEENAKSHI DELHI 2002-12-25 78000

105 RICHA MUMBAI 1996-01-12 95000

106 MANIPRABHA CHENNAI 2001-12-12 69000

COURSE

CID CNAME FEES STARTDATE TID

C201 AGDCA 12000 2018-07-02 101

C202 ADCA 15000 2018-07-15 103

C203 DCA 10000 2018-10-01 102

C204 DDTP 9000 2018-09-15 104

C205 DHN 20000 2018-08-01 101

C206 0 LEVEL 18000 2018-07-25 105

i. Display the Trainer Name, City & Salary in descending order of their Hiredate.
ii. To display the TNAME and CITY of Trainer who joined the Institute in the month of December 2001.
iii. To displayTNAME, HIREDATE, CNAME, STARTDATE from tables TRAINER and COURSE of all those
courses whose FEES is less than or equal to 10000. (iv) To display number of Trainers from each Ans. city.
iv. SELECT TID. TNAME, FROM TRAINER WHERE CITY NOT IN ('DELHT', 'MUMBAI');
v. SELECT DISTINCT TID EROM COURSE;
vi. SELECT TID, COUNT(*), MIN (FEES) FROM COURSE. CROUP BY TID HAVING COUNT(*)>1;
vii. SELECT COUNTS), SUM(FEES) FROM COURSE WHERE STARTDATE< '2018-09- 15';
OR
Consider the following tables STORE and answer the questions:
TABLE: STORE

Item No Item Scode Qty Rate Last Buy

2005 Sharpener Classic 23 60 8 31-JUN-09

2003 Balls 22 50 25 01-FEB-10

2002 Gel Pen Premium 21 150 12 24-FEB-10

2006 Gel Pen Classic 21 250 20 11-MAR-09

2001 Eraser Small 22 220 6 19-JAN-09

2004 Eraser Big 22 110 8 02-DEC-09

2009 Ball Pen 0.5 21 180 18 03-NQV-09

Write SQL commands for the following statements:


i. To display details of all the items in the STORE table in ascending order of LastBuy.
ii. To display ItemNo and Item name of those items from STORE table, whose Rate is more than ₹15.
iii. To display the details of those items whose Supplier code (Scode) is 22 or Quantity in Store (Qty) is more than
110 from the table STORE.
iv. To display minimum rate of items for each Supplier individually as per Scode from the table STORE.
v. To display the item with its quantity which include pen in their name.

You might also like