0% found this document useful (0 votes)
104 views

Class 12 Computer Science Sample Paper Set 5

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
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
104 views

Class 12 Computer Science Sample Paper Set 5

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
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

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/05 Set ~ 5
Roll No. Q.P Code 15/5/5
Candidates must write the Q.P Code
on the title page of the answer-book.

 Please check that this question paper contains 07 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]
Like while, the for loop also works with conditions and truth values.
2. With SQL, how can you return the number of not null records in the Project field of "Students" table? [1]

a) SELECT COLUMNS(*) FROM Students b) SELECT COUNT(*) FROM Students

c) SELECT COLUMNS(Project) FROM d) SELECT COUNT(Project) FROM Students


Students
3. What is the advantage of DBMS over File Processing System? [1]

a) Redundancy is controlled. b) It provides backup and recovery.

c) It provides multiple user interfaces. d) All of these


4. The def keyword is followed by the function name and [1]

a) parentheses b) argument

c) parameter d) classes
5. What is the slice expression that gives every third character of string St, starting with the last character and [1]
proceeding back to the first?
6. Find EVEN parity bit for 10010110 [1]

a) 3 b) 0
c) 2 d) 1
7. ________ method of File Input Stream class closes the file input stream and releases any system resources [1]
associated with the stream.

a) Int read(byte[] b) b) Void write()

c) Int read() d) Void close()


8. Using which language a user can request information from a database? [1]

a) Query b) Structural

c) Relational d) Compiler
9. Which of the following is a SQL aggregate function? [1]

a) JOIN b) LEN

c) AVG d) LEFT
10. Write a statement in Python to perform the following operations: [1]
i. To open a text file "MYPET.TXT" in write mode.
ii. To open a text file "MYPET.TXT" in read mode.
11. State true or false: [1]
A parameter having default value in the function header is known as a default parameter.
12. Which data structure is needed to convert infix notation to postfix notation? [1]

a) Tree b) Stack

c) Queue d) Branch
13. What do you understand by MySQL server instance? [1]
14. A ________ is a network spread across a building, or a factory/plant or campus or nearby buildings. [1]

a) MAN b) PAN

c) WAN d) LAN
15. If L1 = [1, 3, 5] and L2 = [2, 4, 6] then L1 + L2 will yield [1]

a) [3, 7, 11] b) [1, 2, 3, 4, 5, 6]

c) [1, 3, 5, 2, 4, 6] d) [1, 3, 5, [2, 4, 6]]


16. Which of the following sublanguages of SQL is used to define the structure of the relation, deleting relations and [1]
relating schemas?

a) Relational Schema b) DDL (Data Definition Language)

c) DML (Data Manipulation Language) d) Query


17. Find ODD parity bit for 10010110 [1]

a) 0 b) 1

c) 3 d) 2
18. A router: [1]

a) is a work virus b) distributes information between networks

c) screens incoming information d) clears all viruses from a computer system


19. Assertion (A): The intersection_update() method is different from the intersection() method. [1]
Reason (R): intersection_update() method modifies the original set by removing the unwanted items.

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): Python provides the remove() method which is used to remove the file pointer. [1]
Reason (R): The mkdir() method is used to create the directories in the current working directory.

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): The python eval() function parses the expression passed to it. [1]
Reason (R): eval() runs python expression(code) outside of the program.

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 is broadband? [2]
23. Consider the following table order-details of database sales [2]

ORDNUMB PARTNUMB NUMBORD QUOTPRIC

12494 CB03 4 175.00

12495 CX11 2 57.95

12498 AZ52 2 22.95

12500 BT04 1 402.99

Write Python code to increase NUMBORD by 5 if QUOTPRIC is less than 100 or NUMBORD is greater than 3.
24. As immutable types cannot be changed in place then the following code should raise an error which modifies an [2]
int (an immutable type) variable. But it produces no error. Why?
A = 22
A += 2
OR
Explain the use of the pass statement. Illustrate it with an example.
25. Consider the table Student whose fields are [2]

SCODE Name Age strode Points Grade

101 Amit 16 1 6 NULL

102 Arjun 13 3 4 NULL

103 Zaheer 14 2 1 NULL

104 Gagan 15 5 2 NULL

105 Kumar 13 6 8 NULL


Write the Python code to update grade to A for all these students who are getting more than 8 as points.
26. Distinguish between tuple and list. [2]
OR
Find the output

dict = {}
a, b, c = 15, 25, 35
dict[a, b, c] = a + b - c
a, b, c = 25, 20, 40
dict[a, b, c] = a + b - c
print(dict)

27. Write a function stats() that accepts a filename and reports the file's longest line. [2]
OR
Write a method in python to read the content from a text file diary.txt line by line and display the same on-screen.
28. What is the difference between parameters and arguments? [2]
Section C
29. Write the definition of a function Count_Line() in Python, which should read each line of a text file [3]
"SHIVAJI.TXT" and count total number of lines present in text file. For example, if the content of the file
"SHIVAJI.TXT" is as follows:
Shivaji was born in the family of Bhonsle.
He was devoted to his mother Jijabai.
India at that time was under Muslim rule.
The function should read the file content and display the output as follows:
Total number of lines : 3
OR
What is the difference between the formal parameters and actual parameters? What are their alternative names? Also,
give a suitable Python code to illustrate both.
30. Write the queries for the following questions using the table Item with the following fields. [3]
(Item_Code, Item_Name, Quantity, Price)
i. Display the price 500 of item having code as 106.
ii. Display the names of all items with quantity greater than 50 and price less than 500.
iii. Display the item code of all items with quantity less than 70.
OR
Differentiate between char(n) and varchar(n) data types with respect to databases.
31. Define a function overlapping () that takes two lists and returns true if they have at least one member in [3]
common, False otherwise.
OR
From the program code given below, identify the parts mentioned below :
1. def processNumber(x):
2. x = 72
3. return x + 3
4.
5. y = 54
6. res = processNumber(y)
Identify these parts: function header, function call, arguments, parameters, function body, main program.
Section D
32. Write a program that depends upon the user's choice, either pushes or pops an element in a stack. [4]
OR
A line of text is read from the input terminal into a stack. Write a program to output the string in the reverse order,
each character appearing twice.
(ie.g., the string a b c d e should be changed to ee dd cc bb aa)
33. Given a file "dept.dat", containing records of departments with following attributes: [4]
Candidate: Name of the candidates Department:
Department name like: Computer, Physics, Math, Biology, etc. Write a method copy that would read contents
from the file "dept.dat" and creates a file named "com.dat" copying only those records from "dept.dat" where the
department name is "Computer". Assume that is a field separator in "dept.dat".
34. Write SQL commands for (i) to (v) on the basis of the table SPORTS [4]
TABLE: SPORTS

STUDENTNO CLASS NAME GAME1 GRADE GAME2 GRADE1

10 7 Sameer Cricket B Swimming A

11 8 Sujit Tennis A Skating C

12 7 Kamal Swimming B Football B

13 7 Veena Tennis C Tennis A

14 9 Archana Basketball A Cricket A

15 10 Arpit Cricket A Athletics C

i. Display the games taken up by the students, whose name starts with 'A'.
ii. Write a query to add a new column named MARKS.
iii. Write a query to assign a value 200 for Marks for all those, who are getting grade ‘B’ or grade 'A' in both
GAME1 and GAME2.
iv. Which command will be used to arrange the whole table in the alphabetical order of NAME?
a. SELECT FROM SPORTS ORDER BY NAME;
b. SELECT * SPORTS ORDER BY NAME;
c. SELECT * FROM SPORTS ORDER NAME;
d. SELECT * FROM SPORTS ORDER BY NAME;
v. Identify the attribute best suitable to be declared as a primary key.
OR
Consider the following tables WORKER and PAYLEVEL and answer (a) and (b) parts of this question:
Table: WORKER

ECODE NAME DESIGN PLEVEL DOJ DOB

11 Radhe Shyam Supervisor P001 13-Sep-2004 23-Aug-1981

12 Chander Nath Operator P003 22-Feb-2010 12-Jul-1987


13 Fizza Operator P003 14-Jun-2009 14-Oct-1983

15 Ameen Ahmed Mechanic P002 21-Aug-2006 13-Mar-1984

18 Sanya Clerk P002 19-Dec-2005 09-Jun-1983

Table: PAYLEVEL

PLEVEL PAY ALLOWANCE

P001 26000 12000

P002 22000 10000

P003 12000 6000

a. Write SQL commands for the following statements:


i. To display the name of all Workers in descending order of DOB.
ii. To display NAME and DESIGN of those Workers, whose PLEVEL is either P001 or P002.
iii. To display the content of all the workers table, whose DOB is in between '19- JAN-1984' and '18-JAN-1987'.
iv. To add a new row with the following: 19, 'DayaKishore', 'Operator', 'P003', '19- Sep-2008', 17-Jul-1984'
b. Give the output of the following SQL queries:
i. SELECT COUNT (PLEVEL), PLEVEL FROM WORKER GROUP BY PLEVEL;
ii. SELECT MAX(DOB), MIN(DOJ) FROM WORKER;
iii. SELECT Name, PAY FROM WORKER W, PAYLEVEL P WHERE W.PLEVEL = P.PLEVEL AND
W.ECODE < 13;
iv. SELECT PLEVEL, PAY+ ALLOWANCE FROM PAYLEVEL WHERE PLEVEL= "P003 ";
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. What is DNS and also explain its functions? [5]
37. Consider the following tables CABHUB and CUSTOMER and answer (b) and (c) parts of this question: [5]
Table: CABHUB

Vcode VehicleName Make Colour Capacity Charges

100 Innova Toyota WHITE 7 15

102 SX4 Suzuki BLUE 4 14

104 C Class Mercedes RED 4 35

105 A-Star Suzuki WHITE 3 14


108 Indigo Tata SILVER 3 12

Table: CUSTOMER

Ccode Cname Vcode

1 Hemant Sahu 101

2 Raj Lai 108

3 Feroza Shah 105

4 Ketan Dhal 104

a. Give a suitable example of a table with sample data and illustrate Primary and alternate Keys in it.
b. Write SQL commands for the following statements:
i. To display the names of all the white-colored vehicles.
ii. To display the name of vehicle name and the capacity of vehicles in ascending order of their sitting
capacity.
iii. To display the highest charges at which a vehicle can be hired from CABHUB.
iv. To display the customer name and the corresponding name of the vehicle hired by them.
c. Give the output of the following SQL queries:
i. SELECT COUNT (DISTINCT Make) FROM CABHUB;
ii. SELECT MAX(Charges), MIN(Charges) FROM CABHUB;
iii. SELECT COUNT (*) Make FROM CABHUB;
iv. SELECT Vehicle FROM CABHUB WHERE Capacity=4;
OR
Given the following family relation. Write SQL commands for questions (i) to (v) based on the table FAMILY
TABLE: FAMILY

No. Name Female Members Male Members Income Occupation

1 Mishra 3 2 7000 Service

2 Gupta 4 1 50000 Business

3 Khan 6 3 8000 Mixed

4 Chaddha 2 2 25000 Business

5 Yadav 7 2 20000 Mixed

6 Joshi 3 2 14000 Service

7 Maurya 6 3 5000 Farming

8 Rao 5 2 10000 Service

i. To select all the information of family, whose Occupation is Service.


ii. To list the name of family, where female members are more than 3.
iii. To list all names of family with income in ascending order.
iv. To count the number of family, whose income is less than 10000.
v. To display the detail of family whose income is more than 10000 and occupation is mixed type.

You might also like