0% found this document useful (0 votes)
108 views11 pages

Cbse 12 CS SP1

SAMPLE PAPER FOR CBSE 12 CS SP1

Uploaded by

Girish Srivastav
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)
108 views11 pages

Cbse 12 CS SP1

SAMPLE PAPER FOR CBSE 12 CS SP1

Uploaded by

Girish Srivastav
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/ 11

BHAGWAN MAHAVIR INTERNATIONAL SCHOOL

Bharthana, Vesu, Surat

CBSE 12 COMPUTER SCI. SAMPLE PAPER 1 2022-23


Class 12 - Computer Science
Time Allowed: 3 hours Maximum Marks: 70

General Instructions:

1. This question paper contains five sections, from Section A to E.

2. All questions are compulsory.

3. Section A has 18 questions carrying 01 mark each.

4. Section B has 07 Very Short Answer type questions carrying 02 marks each.

5. Section C has 05 Short Answer type questions carrying 03 marks each.

6. Section D has 03 Long Answer type questions carrying 05 marks each.

7. Section E has 02 questions carrying 04 marks each. One internal choice is given in Q35 against part c only.
8. All programming questions are to be answered using Python Language only.

Section A
1. State true or false: [1]
A string can be surrounded by three sets of single quotation marks or by three sets of double quotation marks.
2. Which of the following attributes can be considered as a choice for the primary key? [1]

a) Street b) Subject

c) Roll No d) Name
3. The set of records retrieved after executing an SQL query over an established database connection is called [1]
________.

a) table b) resultset

c) sqlresult d) result
4. Which of the following function calls will cause Error while invoking the below function definition? [1]
def test(a, b, c, d)
i. test(1, 2, 3, 4)
ii. test(a = 1, 2, 3, 4)
iii. test(a = 1, b = 2, c = 3, 4)
iv. test(a = 1, b = 2, c = 3, d = 4)

a) (i) and (iv) b) (iii) and (iv)

c) (i) and (ii) d) (ii) and (iii)


5. Which of the following is a client-side scripting language? [1]

a) Perl b) PHP

1 / 11
Powered by EducoPRO
c) VB Script d) Ruby
6. We need to use some devices to store the data: [1]

a) Floppy disk b) Compact disk

c) Hard disk d) All of these


7. Which of the given point is false regarding SQL? [1]

a) SQL is portable(work on any machine i.e b) SQL has high speed(can query large
PC, mainframe etc.) volumes of data)

c) SQL can be used with any DBMS d) SQL can not work with relational databases
8. What is the full form of DDL? [1]

a) Data Definition Language b) Dynamic Data Language

c) Detailed Data Language d) Data Derivation Language


9. Which function is used to write all the characters? [1]

a) writecharacters( ) b) writeall( )

c) write( ) d) writeallchars( )
10. Which of the following functions removes all leading and trailing spaces from a string? [1]

a) rstrip() b) lstrip()

c) strip() d) all of these


11. Which data structure is needed to convert infix notation to postfix notation? [1]

a) Tree b) Stack

c) Queue d) Branch
12. Which of the following function headers is correct? [1]

a) def f(a = 1, b = 1, c = 2): b) def f(a = 1, b, c = 2):

c) def f(a = 1, b = 1, c = 2, d): d) def f(a = 1, b):


13. 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


14. ________ are drawn using certain special purpose symbols. [1]

a) Flowchart b) Algorithm

c) Decision table d) Pseudocode


15. Find EVEN parity bit for 10010110 [1]

a) none of these b) 0

c) 2 d) 1
16. Network congestion occurs: [1]

a) in case of traffic overloading b) none of these

c) when a system terminates d) when connection between two nodes

2 / 11
Powered by EducoPRO
terminates
17. Assertion (A): The tuple is used in the cases where we need to store the read-only collections. [1]
Reason (R): The literal syntax of the tuple is shown by the [].

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.


18. 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.


Section B
19. Explain any two switching techniques used in networking. [2]
20. Write a Python program that calculates and prints the number of seconds in a year. [2]
OR
Find the errors in the following code and write the correct code.
s = [11, 13, 15]
for n in len(s) :
tot = tot + s[n]
print(tot)
i. Underline the corrections.
ii. Write the reason! error next to it in the comment form.
21. Write Python code to delete all the records from the Employee table whose age >60 the table has following [2]
fields.
Empid, EmpName, Deptid, age, Payscale
22. Answer: [2]
(i) What will the following query do?
import mysql.connector
db = mysql.connector.connect(.. )
cursor = db.cursor( )
db.execute("SELECT * FROM staff WHERE person_id in {}".format((1,3,4)))
db.commit( )
db.close( )
(ii) Which package must be imported in Python to create a database connectivity application?
23. Riya was asked to accept a list of even numbers but she did not put the relevent condition while accepting the [2]
list of numbers. You are required to write a user defined function oddtoeven (L) that accepts the list L as an
argument and convert all the odd numbers into even by multiplying them by 2.
24. Correct the following code [2]

3 / 11
Powered by EducoPRO
i. x = 5
print(x)
y = 10
print(y)
a = x + y
print(a)

ii. sub = “Math”


marks = 80
print(“Value of subject and marks are”, sub + marks)

iii. x = 5
b = x + 5
x = Try
d = x/20

OR
Find the error in the following code fragment. State the reason behind the error.
box = { }
jars = { }
crates = { }
box['biscuit'] =1
box['cake'] = 3
jars['jam'] = 4
crates['box'] = box
crates['jars'] = jars
print (crates[box])
25. Write a function AMCount() in Python, which should read each character of a text file STORY.TXT, should [2]
count and display the occurrence of alphabets A and M (including small cases a and m too).
Example: If the file content is as follows:
Updated information
As simplified by official websites.
The EUCount() function should display the output as:
A or a : 4
M or m : 2
OR
Your recipe uses some ingredients. Write a program to store the list of ingredients in a binary file.
Section C
26. Answer: [3]
(i) Find the error(s).
L1 = [7, 2, 3, 4]
L2 = L1 + 2
L3 = L1 * 2
L = L1. pop(7)

4 / 11
Powered by EducoPRO
(ii) Write the one example of following terms.
i. Identifier
ii. Punctuator
iii. Keyword
iv. Constant
27. Give output for following queries as per given table(s): [3]
Table: DOCTOR

ID NAME DEPT SEX EXPERIENCE

101 John ENT M 12

104 Smith ORTHOPEDIC M 5

107 George CARDIOLOGY M 10

114 Lara SKIN F 3

109 K George MEDICINE F 9

105 Johnson ORTHOPEDIC M 10

117 Lucy ENT F 3

111 Bill MEDICINE F 12

130 Morphy ORTHOPEDIC M 15

Table: SALARY

ID BASIC ALLOWANCE CONSULTATION

101 12000 1000 300

104 23000 2300 500

107 32000 4000 500

114 12000 5200 100

109 42000 1700 200

105 18900 1690 300

130 21700 2600 300

i. SELECT count(*) FROM DOCTOR WHERE SEX = "F".


ii. SELECT NAME, DEPT, BASIC FROM DOCTOR, SALARY
WHERE DEPT = "ENT" AND DOCTOR.ID = SALARY.ID;
OR
What is SQL? What are the different categories of commands available in SQL?
28. Write a function that takes a sorted list and a number as an argument. Search for the number in the sorted list [3]
using binary search.
29. Write a method in python to read the content from a text file diary.txt line by line and display the same on- [3]
screen.
30. What will be the output of following programs? [3]

5 / 11
Powered by EducoPRO
i. num = 1
def myfunc():
return num
print(num)
print(myfunc())
print(num)
ii. num = 1
def myfunc():
num = 10
return num
print(num)
print(myfunc())
print(num)
iii. num = 1
def myfunc():
global num
num = 10
return num
print(num)
print(myfunc())
print(num)
iv. def display ():
print ("Hello", end = ' ')
display()
print("there!")
OR
Trace the flow of execution for following programs:
i. 1 def power(b., p):
2 r = b ** p
3 return r
4
5 def cpower(a):
6a=a+2
7 a = power(a, 0.5)
8 return a
9
10 n = 5
11 result = cpower(n)
12 print (result)
ii. 1. def increment(x)
2. x = x + 1
3.

6 / 11
Powered by EducoPRO
4. # main program
5. x = 3
6. print(x)
7. increment(x)
8. print(x)
iii. 1. def increment(x):
2. z = 45
3. x = x + 1
4. return x
5.
6. # main
7. y = 3
8. print(y)
9. y = increment(y)
10. print(y)
11. q = 77
12. print(q)
13. increment(q)
14. print(q)
15. print(x)
16. print(z)
Section D
31. Write Push (contents) and Pop (contents) methods in Python to add numbers and remove numbers considering [5]
them to act as Push and Pop operations of stack.
32. Answer (i) & (ii) OR (iii) & (iv) [5]
(i) Write a method in Python to write multiple line of text contents into a text file diary.txt.
(ii) Write code to open file contacts.txt with shown information and print it in the following form:
Name : <name>
Phone : <phone number>
(iii) Define the following terms:
i. dump() method
ii. load() method
(iv) If the file 'poemBTH.txt' contains the following poem (by Paramhans Yoganand):
God made the Earth;
Man-made confining countries
And their fancy-frozen boundaries.
But with unfound boundless Love
I behold the borderland of my India
Expanding into the World.
Hail, mother of religions, Lotus, scenic beauty and sages!
What outputs will be produced by both the code fragments given below:

7 / 11
Powered by EducoPRO
a. my_file =open('poemBTH.txt', 'r')
my_file.read()
b. my_file = open('poemBTH.txt', 'r')
my_file.read(100)
33. Give output for following SQL queries as per given table(s): [5]
Table: WORKERS

W_ID FIRSTNAME LASTNAME ADDRESS CITY

102 Sam Tones 33 Elm St. Paris

105 Sarah Ackerman ‘ 440 U.S. 110 New York

144 Manila Sengupta 24 Friends Street New Delhi

210 George Smith 83 First Street Howard

255 Mary Jones 842 Vine Ave. Losantiville

300 Robert Samuel 9 Fifth Cross Washington

335 Henry Williams 12 Moore Street Boston

403 Ronny Lee 121 Harrison St. New York

451 Pat Thompson 11 Red Road Paris

Table: DESIG

W_ID SALARY BENEFITS DESIGNATION

102 75000 15000 Manager

105 85000 25000 Director

144 70000 15000 Manager

210 75000 12500 Manager

255 50000 12000 Clerk

300 45000 10000 Clerk

335 40000 10000 Clerk

400 32000 7500 Salesman

451 28000 7500 Salesman

i. SELECT FIRSTNAME, SALARY


FROM WORKERS, DESIG
WHERE DESIGNATION = 'Manager' AND
EMPLOYEE.WJD = DESIG.W.ID;
ii. SELECT COUNT (DISTINCT DESIGNATION) FROM DESIG;
iii. SELECT DESIGNATION, SUM(SALARY)
FROM DESIG
GROUP BY DESIGNATION HAVING COUNT(*) < 3;

8 / 11
Powered by EducoPRO
iv. SELECT SUM(BENEFITS)
FROM WORKERS
WHERE DESIGNATION = 'Salesman';
OR
Write SQL queries for (i) to (vii) on the basis of table ITEMS and TRADERS:
Table: ITEMS

ICODE INAME QTY PRICE COMPANY TCODE

1001 DIGITAL PAD 12i 120 11000 XENITA T01

1006 LED SCREEN 40 70 38000 SANTORA T02

1004 CAR GPS SYSTEM 50 21500 GEOKNOW T01

1003 DIGITAL CAMERA 12X 160 8000 DIGICLICK T02

1005 PEN DRIVE 32 GB 600 1200 STOREHOME T03

Table: TRADERS

TCode TName City

101 ELECTRONIC SALES MUMBAI

103 BUSY STORE CORP DELHI

102 DISP HOUSE INC CHENNAI

i. To display the details of all the items in ascending order of item names (i.e., INAME).
ii. To display item name and price of all those items, whose price is in the range of 10000 and 22000 (both values
inclusive).
iii. To display the number of items, which are traded by each trader. The expected output of this query should be:
T01 2 T02 2 T03 1
iv. To display the price, item name and quantity (i.e., qty) of those items which have quantity more than 150.
v. To display the names of those traders, who are either from DELHI or from MUMBAI.
vi. To display the names of the companies and the names of the items in descending order of company names.
vii. Obtain the outputs of the following SQL queries based on the data given in tables ITEMS and TRADERS above.
a. SELECT MAX (PRICE), MIN (PRICE) FROM ITEMS;
b. SELECT PRICE*QTY FROM ITEMS WHERE CODE=1004;
c. SELECT DISTINCT TCODE FROM ITEMS;
d. SELECT INAME, TNAME FROM ITEMS I, TRADERS T WHERE I.TCODE=T.TCODE AND QTY<100;
Section E
34. Read the text carefully and answer the questions: [4]
Learn Together is an educational NGO. It is setting up its new campus at Jabalpur for its web-based activities.
The campus has 4 compounds as shown in the diagram below:

9 / 11
Powered by EducoPRO
Center to center distances between various Compounds as per architectural drawings (in Metre) is as follows:

Main Compound to Resource Compound 110 m

Main Compound to Training Compound 115 m

Main Compound to Finance Compound 35 m

Resource Compound to Training Compound 25 m

Resource Compound to Finance Compound 135 m

Training Compound to Finance Compound 100 m

The Expected Number of Computers in each Compound is as follows:

Main Compound 5

Resource Compound 15

Training Compound 150

Accounts Compound 20

(i) Suggest the most suitable place (i.e., compound) to house the server for this NGO. Also, provide a suitable
reason for your suggestion.
(ii) Suggest the placement of Repeater with justification.
(iii) The NGO is planning to connect its International office situated in Mumbai, which out of the following
wired communication link, you will suggest for very high-speed connectivity?
i. Telephone Analog Line
ii. Optical Fiber
iii. Ethernet Cable
OR
Suggest the placement of Hub/Switch with justification.
35. Read the text carefully and answer the questions: [4]
Consider the following tables STORE and SUPPLIERS:
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

10 / 11
Powered by EducoPRO
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

(i) 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.
(ii) Write SQL commands for the following statements:
i. 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.
ii. To display minimum Rate of items for each supplier individually as per Scode from the table STORE.
(iii) Give the output of the following SQL queries:
i. SELECT COUNT(DISTINCT Scode) FROM STORE;
ii. SELECT Rate* Qty FROM STORE WHERE ItemNo = 2004;

11 / 11
Powered by EducoPRO

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy