[go: up one dir, main page]

0% found this document useful (1 vote)
759 views14 pages

Class 12 Computer Science Sample Paper Set 15

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 (1 vote)
759 views14 pages

Class 12 Computer Science Sample Paper Set 15

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/ 14

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

 Please check that this question paper contains 10 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]
A list may contain any type of objects except another list.
2. The HAVING clause does which of the following? [1]

a) Acts like a WHERE clause but is used for b) Acts like a WHERE clause but is used for
columns rather than groups. rows rather than columns.

c) Acts like a WHERE clause but is used for d) Acts EXACTLY like a WHERE clause.
groups rather than rows.
3. Which of the following is a procedural language? [1]

a) Relational Algebra b) Query Language

c) Tuple Relational Calculus d) Domain Relational Calculus


4. Which value type does input( ) return? [1]

a) Float b) Boolean

c) Int d) String
5. Consider the following code. What output will it produce and why? [1]
>>> rec = { }
>>> print(rec == None)
6. Which of the following is the fastest media of data transfer? [1]

a) Fibre Optic b) Telephone Lines

c) Untwisted Wire d) Co-axial Cable


7. Which function is used to read all the characters? [1]

a) readcharacters( ) b) read( )

c) readchar( ) d) readall( )
8. Which of the following is not a legal method for fetching records from database from within Python? [1]

a) fetchtwo( ) b) fetchall( )

c) fetchone( ) d) fetchmany( )
9. Which clause is used with "aggregate functions"? [1]

a) GROUP BY b) WHERE

c) SELECT d) Both GROUP BY and WHERE


10. What will happen with the following code? [1]
file1 = open ("c:\\users\\temp\\myfile.text",r)
file1.seek (2,-10)
print "The pointer is at", file1.tell()
file1.close()
11. State true or false: [1]
Variables defined inside functions can have global scope.
12. What is the result of the following operation? [1]
Top(Push (s, x))

a) s b) Null

c) Both d) x
13. Name any two logical operators. [1]
14. The ________ translates internet domain and hostnames to IP address. [1]

a) internet relay chat b) routing information protocol

c) network time protocol d) domain name system


15. You can repeat the elements of the tuple using which operator? [1]

a) ** b) +

c) % d) *
16. Which of the following is the correct expansion of DML in context of SQL? [1]

a) Direct Machine Language b) Data Manipulation Language

c) Distributed Machine Language d) Data Mixing Language


17. Which of the following is the fastest media of data transfer? [1]

a) Fibre Optic b) Untwisted Wire

c) Co-axial Cable d) Telephone Lines


18. Which of the following technology is a packet oriented mobile data service on the 2G and 3G cellular [1]
communication?

a) GPRS b) CDMA

c) WLL d) GSM
19. Assertion (A): Sets are mutable in nature. [1]
Reason (R): Each element in set must be unique and immutable.

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): To read from the openpyxl we need to install an openpyxl module using pip from the command [1]
line.
Reason (R): openpyxl allows the user to perform calculations and add content that was not part of the original
dataset.

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 bytes() in Python is used for returning a bytes object. [1]
Reason (R): It is a mutable version of the bytearray() 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 is broadband? [2]
23. The book's table of test database contains the records shown here. [2]

Title ISBN

Die to Live 78127873915

Again? 23686286243

Ushakaal 12678987036

Ushakiran' 42568987036

What will be the output produced by following code?


import mysql.connector as sqltor
conn = sqltor.connect (host = "localhost", user = "learner", passwd = "fast", database ="test")
cursor = conn.cursor( )
cursor.execute("SELECT * FROM books")
row = cursor.fetchone( )
while row is not None:
print(row)
row = cursor.fetchone( )
24. Observe the given list and find the answer of questions that follows. [2]
list1 = [23, 45, 63, ‘Hello’, 20 ‘World’, 15, 18]
i. list1 [-3]
ii. list[3]
OR
Write a Python program that calculates and prints the number of seconds in a year.
25. Consider the following table Traders with following fields [2]

TCode TName City

T01 Electronic Sales Mumbai

T03 Busy Store Corp Delhi

T02 Disp House Inc Chennai

Write Python code to display the names of those traders who are either from Delhi or from Mumbai.
26. Find the output of the given questions [2]

t = (4, 0, 'Hello', 90 'Two', ('One', 45), 34, 2)

i. t [ 5 ]
ii. t[3 : 7]
iii. t[1] + t[- 2]
OR
Identify the types of following literals.

False 'True' "False"

45345 0O434 435.3

27. Write a function to count the number of lines starting with uppercase character text file "Help.doc". [2]
OR
Write a function count_Dwords () in Python to count the words ending with a digit in a text file "Details.txt".
Example:
If the file content is as follows:
On seat2 VIP1 will sit and
On seat1 VVIP2 will be sitting
Output will be:
Number of words ending with a digit are 4
28. Write the corresponding Python expression for the following mathematical expressions: [2]

i. 2 - ye2y + 4y
ii. |ex - x2 - x|
Section C
29. Find the errors in code given below: [3]
i. def minus(total, decrement)
output = total - decrement
print(output)
return (output)
ii. define check()
N = input ('Enter N:')
i=3
answer = 1 + i * * 4/N
Return answer
iii. def alpha(n, string = 'xyz', k = 10) :
return beta(string)
return n
def beta (string)
return string == str(n)
print(alpha("Valentine's Day"):)
print(beta (string = 'true'))
print(alpha(n=5, "Good-bye") :)
OR
Consider a function with following header:
def info(object, spacing = 10, collapse = 1)
Here are some function calls given below. Find out which of these are correct and which of these are incorrect stating
reasons?
For correct function call statements, specify the argument values too.
i. info(obj1)
ii. info(spacing=20)
iii. info(obj2, 12)
iv. info(obj11, object = obj12)
v. info(obj3, collapse = 0)
vi. info( )
vii. info(collapse = 0, obj3)
viii. info( spacing = 15, object = obj4)
30. Consider the following table EMPLOYEE in a Database COMPANY: [3]
Table: EMPLOYEE

E_ID NAME DEPT

H1001 Avneet AC

A1002 Rakesh HR

A1003 Amina AC

H1002 Simon HR

A1004 Pratik AC

Assume that the required library for establishing the connection between Python and MySQL is already
imported in the given Python code. Also assume that DB is the name of the database connection for the given
table EMPLOYEE stored in the database COMPANY.
Predict the output of the following Python code:

CUR=DB.cursor()
CUR.execute("USE COMPANY")
CUR.execute("SELECT * FROM EMPLOYEE WHERE DEPT = 'AC' ")
for i in range(2):
R=CUR.fetchone()
print(R[0], R[1], sep ="#")

OR
Explain Primary Key in the context of Relational Database Model. Support your answer with suitable example.
31. What is the utility of: [3]
i. default arguments
ii. keyword arguments
OR
Write definition of a method EvenSum(NUMBERS) to add those values in the list of NUMBERS, which are not odd.
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 Python program to check if a string is a palindrome or not using stack.
33. Write a function to create a text file containing the following data: [4]
Neither Apple nor pine are in pineapple. Boxing rings are square.
Writers write, but fingers don't fing. Overlook and oversee are opposites. A house can burn up as it burns down.
An alarm goes off by going on.
i. Read back the entire file content using read() or readlines() and display on the screen.
ii. Append more text of your choice in the file and display the content of file with line numbers prefixed to line.
iii. Display last line of file.
iv. Display first line from 10th character onwards
v. Read and display a line from the file. Ask user to provide the line number to be read.
34. Give output for following SQL queries as per given table(s) : [4]
relation Teacher

No. Name Age Department Date of join Salary Sex

1. Jugal 34 Computer 10/01/97 12000 M

2. Sharmila 31 History 24/03/98 20000 F

3. Sandeep 32 Maths 12/12/96 30000 M


4. Sangeeta 35 History 01/07/99 40000 F

5. Rakesh 42 Maths 05/09/97 25000 M

6. Shyam 50 History 27/06/98 30000 M

7. Shiv Om 44 Computer 25/02/97 21000 M

8. Shalakha 33 Maths 31/07/97 20000 F

i. SELECT COUNT (distinct department) FROM TEACHER;


ii. SELECT MAX (Age) FROM TEACHER WHERE Sex = "F";
iii. SELECT AVG(Salary) FROM TEACHER WHERE Dateofjoin< {12/07/96};
iv. SELECT SUM (Salary) FROM TEACHER WHERE Dateofjoin < {12/07/96}
OR
Consider the following tables ACTIVITY and COACH and answer (a) and (b) parts of this question:
Table: ACTIVITY

ACode ActivityName Stadium ParticipantsNum PrizeMoney ScheduleDate

1001 Relay 100 × 4 Star Annex 16 10000 23-Jan-2004

1002 High Jump Star Annex 10 12000 12-Dec-2003

1003 Shot Put Super Power 12 8000 14-Feb-2004

1005 Long Jump Star Annex 12 9000 01-Jan-2004

1008 Discuss Throw Super Power 10 15000 19-Mar-2004

Table: COACH

PCode Name ACode

1 Ahmad Hussain 1001

2 Ravinder 1008

3 Janila 1001

4 Naaz 1003

a. Write SQL commands for the following statements:


i. To display the names of all activities with their Acodes in descending order.
ii. To display sum of PrizeMoney for the Activities played in each of the Stadium separately.
iii. To display the coach's name and Acodes in ascending order of Acode from the table Coach.
iv. To display the content of the Activity table whose schedule date earlier than 01-01-2004 in ascending order of
Participants Num.
b. Give the output of the following SQL queries:
i. SELECT COUNT (DISTINCT Participants Num) FROM ACTIVITY;
ii. SELECT MAX (Schedule Date), Min (Schedule Date) FROM ACTIVITY;
iii. SELECT Name, Activity Name FROM ACTIVITY A, COACH C WHERE A. Acode=C. Acode AND
A.Participants Num=10;
iv. SELECT DISTINCT Acode FROM COACH;
35. Consider table faculty in database EngColl with following structure. [4]
Id → Faculty id. (Primary Key)
lastname → Lastname of the faculty member
Firstname → Firstname of the faculty member
locationid → Location id of the member,
phone → Phone Number of the member,
rank → It can be either 'ASSO', 'FULL', ASST', 'INST'
startdate → date of joining of the member.
Write a Python code to update the rank of the member as 'FULL' for all the records whose data
of joining is before 31/3/1998.
Password of database is pwdfac, and userid is Fac_dep
Section E
36. Granuda Consultants are setting up a secured network for their office campus at Faridabad for their day to day [5]
office and web-based activities. They are planning to have connectivity between 3 buildings and the head office
situated in Kolkata. Answer the questions (i) to (iv) after going through the building positions on the campus and
other details, which are given below:

Distances between various buildings:

Building "RAVI" to Building "JAMUNA" 120 m

Building "RAVI" to Building "GANGA" 50 m

Building "GANGA" to Building "JAMUNA" 65 m

Faridabad Campus to Head Office 1460 KM

Number of Computers

Building "RAVI" 25

Building "JAMUNA" 150

Building "GANGA" 51

Head Office 10

i. Suggest the most suitable place (i.e.r block) to house the server of this organization. Also, give a reason to
justify your suggested location.
ii. What type of network will be formed if all buildings are connected?
iii. Suggest the placement of the following devices with justification:
a. Switch
b. Repeater
iv. The organization is planning to provide a high-speed link with its head office situated in the KOLKATA
using a wired connection. Which of the following cables will be most suitable for this job?
a. Optical Fibre
b. Co-axial Cable
c. Ethernet Cable
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 SUPPLIERS and answer (a) and (b) parts of this question:
Table: STORE

ItemNo Item Scode Qty Rate LastBuy

2005 Sharpener Classic 23 60 8 31-Jun-09

2003 Ball Pen 0.25 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-Nov-09

Table: SUPPLIERS

Scode Sname

21 Premium Stationers

23 Soft Plastics

22 Tetra Supply

a. 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 Rupees.
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.
b. Give the output of the following SQL queries:
i. SELECT COUNT(DISTINCT Scode) FROM STORE;
ii. SELECT Rate* Qty FROM STORE WHERE ItemNo = 2004;
iii. SELECT Item, Sname FROM STORE S, Suppliers P WHERE S.Scode= P.Scode AND ItemNo = 2006;
iv. SELECT MAX(LastBuy) FROM STORE;

You might also like