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

CS Sample Paper 10

This document contains a sample paper for the Computer Science Class 12 exam. It has 5 sections (A-E) with a total of 35 multiple choice questions. Section A has 18 one-mark questions. Section B has 7 two-mark questions. Section C has 5 three-mark questions. Section D has 2 four-mark questions. Section E has 3 five-mark questions. All programming questions must be answered in Python. The paper tests concepts related to Python, databases, networking, and other computer science topics.

Uploaded by

bdharshini06
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)
225 views

CS Sample Paper 10

This document contains a sample paper for the Computer Science Class 12 exam. It has 5 sections (A-E) with a total of 35 multiple choice questions. Section A has 18 one-mark questions. Section B has 7 two-mark questions. Section C has 5 three-mark questions. Section D has 2 four-mark questions. Section E has 3 five-mark questions. All programming questions must be answered in Python. The paper tests concepts related to Python, databases, networking, and other computer science topics.

Uploaded by

bdharshini06
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/ 8

Page 1 Sample Paper 10 Computer Science Class 12

Sample Paper 10
Computer Science (083)
CLASS XII 2023-24
Time: 3 Hours Max. Marks: 70
General Instructions:
1. Please check this question paper contains 35 questions.
2. The paper is divided into 4 Sections- A, B, C, D and E.
3. Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark
4. Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
5. Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
6. Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
7. Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
8. All programming questions are to be answered using Python Language only.

Section A
1. The output of print(math.ceil(17.34)) is
(a) 18 (b) 17
(c) 10 (d) 20

2. The...........clause is used in SQL to specify a range of values.


(a) WHERE (b) DROP
(c) BETWEEN (d) RANGE

3. Two friends have connected their computers , but are getting weak signals. Which device need to be used to get
better signals?
(a) Repeater (b) Hub
(c) Switch (d) Modem

4. ______method creates a cursor object while connecting a Python application with a Mysql database.
(a) connection( ) (b) connect( )
(c) cursor( ) (d) None of these

5. The default mode in which a file is opened is


(a) r (b) rw+
(c) w (d) a

6. Which attribute is used to return access mode with that file was opened?
(a) mode.file (b) mode.file.name
(c) file.mode (d) file.mode.type

7. Which of the following is not a DDL command ?


(a) ALTER (b) CREATE
(c) DROP (d) DELETE

8. State True or False


‘A dictionary is ordered by index”.
Install NODIA App to See the Solutions.
Click Here To Install
Page 2 Sample Paper 10 Computer Science Class 12

9. The module required to use the mode function is


(a) math (b) statistics
(c) random (d) Pandas

10. The.........command can be used to remove all records of a table along with the table structure.
(a) DELETE TABLE (b) DROP TABLE
(c) REMOVE TABLE (d) None of these

11. What is the output of the following code?


>>> a = 10
>>> b = 2
>>> print(a + 10 * 2 + b)
(a) 32 (b) 22
(c) 40 (d) 80

12. Which function is used to generate a sequence of numbers overtime?


(a) range() (b) len()
(c) limit() (d) lim()

13. Which of the following symbol is used in Python for comments?


(a) $ (b) @
(c) // (d) #

14. Given a list Lst= [65,182,90,420,20,10]. What will be the correct statement to take out the 3rd element from the list?
(a) Lst.pop(2) (b) L.find(2)
(c) L.pop(–1) (d) L.del(90)

15. The relation between Primary key , Candidate key and Alternate key is
(a) Primary key = Candidate key - Alternate key
(b) Candidate key= Primary key - Alternate key
(c) Alternate key= Primary key+ Candidate key
(d) None of the above

16. The first integrity rule for relational databases ensures that_____
(a) Primary key is unique
(b) Foreign key is unique
(c) Primary key is unique and NOT NULL
(d) There is only one candidate key

Directions (Q.Nos. 17-18) are Assertion and Reason based questions.

17. Assertion (A) User-defined functions must stay in a Python module.


Reason (R) Each user-defined function must stay in a module ,which is linked to a folder where all the user defined
functions of the module stay.
(a) Both A and R are true and R is the correct explanation for A.
(b) Both A and R are true but R is not the correct explanation for A.
(c) A is true but R is false.
(d) A is false but R is true.

Install NODIA App to See the Solutions.


Click Here To Install
Page 3 Sample Paper 10 Computer Science Class 12

18. Assertion (A) Python supports addition of data in file , preserving the previous data.
Reason (R) The write mode erases all previous data of a pre-existing file.
(a) Both A and R are true and R is the correct explanation for A.
(b) Both A and R are true but R is not the correct explanation for A.
(c) A is true but R is false.
(d) A is false but R is true.

Section B
19. Write the corresponding Python expression for the following mathematical expression.
(i) z= a/a+ b – d2
(ii) z= x2 + y3

20. Mr. GopiNath Associate Manager of Unit. Nations corporate recently discovered that the communication between
his company’s accounts office and HR office is extremely slow and signals drop quite frequently. These offices are
120 metre away from each other and connected by an Ethernet cable.
(i) Suggest him a device which can be installed in between the office for smooth communication.
(ii) What type of network is formed by having this kind of connectivity out of LAN, MAN and WAN?
 o
Define hub and write its functions and types.

21. (a) Determine which of the following identifiers are valid. If invalid, explain with reason.
(i) name_1 (ii) _SUM
(iii) $Sum (iv) num ^ 2
(b) Find the output of the following code
i=1
while (i<5):
print(i)
i=i*2

22. Differentiate between char(n) and varchar(n) data types with respect to databases.

23. (a) Mention any two advantages of E-mail over conventional, mail.
(b) Mr. Lal owns a factory which manufactures automobile spare parts. Suggest him the advantages of having a
web page for his factory

24. Name the tokens that are available in Python.


 o

Find the syntax error in the following program and underline after correct them.
90 = w
while(w > 60)
print(w)
w = w – 50

25. Explain the use of ORDER BY clause.


 o
What are DDL and DML?

Install NODIA App to See the Solutions.


Click Here To Install
Page 4 Sample Paper 10 Computer Science Class 12

Section C
26. Consider the tables FAMILY and Occupation:
TABLE FAMILY
No Name Female Members Male Members Income Occup-ationId
1 Mishra 3 2 7000 O1
2 Gupta 4 1 50000 O2
3 Khan 6 3 8000 O2
4 Chaddha 2 2 25000 O1
5 Yadav 7 2 20000 O3
6 Joshi 3 2 14000 O2
7 Maurya 6 3 5000 O1
8 Rao 5 2 10000 O3

Table : OCCUPATION
Occupationld Type
O1 Service
O2 Business
O3 Mixed
(a) To display Family name , corresponding occupation and income where male members are more than 2.
(b) Write SQL queries for statements (i) to (iv) based on tables FAMILY and Occupation.
(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.

27. Write a method countFile() to count and display the number of lines starting with the word ‘FILE’ (including small
cases and upper cases) present in a text file “start.txt”.
e.g. If the file “start.txt” contains the following lines:
Get the data value to be deleted,
Open the file for reading from it.
Read the complete file into a list
Delete the data from the list
Open the file
Open same file for writing into it
Write the modified list into file.
Close the file.
The method should display
Total lines started with word ‘FILE’ is/are: 0

o
Write definition of a function that takes input a sentence and display the list of words that end with a lowercase
vowel and list of words that end with a lowercase consonant

Install NODIA App to See the Solutions.


Click Here To Install
Page 5 Sample Paper 10 Computer Science Class 12

28. (a) Study the following tables DOCTOR and SALARY and write SQL commands for the questions (i) to (iv).
TABLE: DOCTOR
ID NAME DEPT SEX E X P E R -
IENCE
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) Display NAME of all doctors who are in MEDICINE department having more than 10yrs experience from
the table DOCTOR.
(ii) Display the average salary of all doctors working in ENT department using the tables DOCTOR and
SALARY. SALARY = BASIC + ALLOWANCE.
(iii) Display the minimum ALLOWANCE of female doctors.
(iv) Display the highest consultation fee among all male doctors.
(b) Write the command to change the data type of consultation to double(8,3).

29. Write a program to count the frequency of elements in a list entered by user.

30. Write the Push operation of stack containing person names. Notice that the name should only accept characters,
spaces and period (.) except digits. Assume that Pname is a class instance attribute.

 o

Find the final contents of a stack that encq]lnters the following tokens.
Assume that an operand is pushed to stack and a binary operator pops two operands from stack and pushes the result
to the stack.
(100, 8, 3, *, 50, 2, +, +, *)

Install NODIA App to See the Solutions.


Click Here To Install
Page 6 Sample Paper 10 Computer Science Class 12

Section D
31. Workalot consultants are setting up a secured network for their office campus of Gurgaon for their day-to-day office
and web based activities. They are planning to have connectivity between 3 buildings and the head office situated
in Mumbai.
Answer the questions (i) to (v) after going through the building positions in the campus and other details, which are
given below:

Distance between various buildings


Building GREEN to Building RED 110 m
Building GREEN to Building BLUE 45 m
Building BLUE to Building RED 65 m
Gurgaon Campus to Head Office 1760 km
Number of computers
Building GREEN 32
Building RED 150
Building BLUE 45
Head Office 10
(i) Suggest the most suitable place (i.e. building) to house the server of this organisation. Also, give a reason to
justify your suggested location.
(ii) Suggest a cable layout of connections between the buildings inside the campus.
(iii) Suggest the placement of the following devices with justification :
(a) Switch
(b) Repeater
(iv) Write the use of Modem in a network.
(v) What is the use of firewall in network?

32. (a) Write a Python program to concatenate following dictionaries to create a new one.
d1={‘A’:10, ‘B’:20}
d2={‘C’:30, ‘D’:40}
d3={‘E’:50, ‘F’:60}
(b) Consider the table MobileStock with following fields
M_Id, M_Name, M_Qty, M_Supplier
Write the Python code to fetch all records with fields M_Id, M_Name and M_Supplier from database Mobile.

Install NODIA App to See the Solutions.


Click Here To Install
Page 7 Sample Paper 10 Computer Science Class 12

o
(a) 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.
(i) Push those marks into a stack which are greater than 75.
(ii) Pop and display the content of the stack.
Simple Input
Marks = [75, 80, 56, 90, 45, 62, 76, 72]
Sample Output
80 90 76
(b) Consider the following table Traders with following fields

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.

33. What is difference between tell() and seek() methods?


A Binary file “lottery.dat” stores details of lottery ticket holders . The file stores the following details :
TicketNo State Type Prizemoney
Write a program using two functions to operate the file data.
(a) AddBuyers(State) : To accept more ticket details and store them into the file only if the ticket is not from state
passed as parameter to the function.
(b) TicketSearch(tid) : To open the file “lottery.dot” and display details of the ticket whose id is supplied as the
parameter to the function.
 o
Compare text files and binary files.
A Binary file “car.dat” stores details of cars. The file stores the following details :
CarNo Brand Kms Cost
Write a program using two functions to operate the file data.
(a) AddCardata() : To accept car details and store them into the file “car.dat”
(b) CarReport() : To open the file “car.dat” and display details of the cars who have run more than 100000 kilometres.

Install NODIA App to See the Solutions.


Click Here To Install
Page 8 Sample Paper 10 Computer Science Class 12

Section E
34. Consider the following table FLIGHTS :
TABLE : FLIGHTS
FL_NO STARTING ENDING NO_FLIGHT NO_
STOPS
IC301 MUMBAI DELHI 8 0
IC799 BENGALURU DELHI 2 1
MC101 INDORE MUMBAI 3 0
IC302 DELHI MUMBAI 8 0
AB812 KANPUR BENGALURU 3 1
IC899 MUMBAI KOCHI 1 4
AM501 DELHI TRIVANDRUM 1 5
MU499 MUMBAI MADRAS 3 3
IC701 DELHI AHMEDABAD 4 0
(i) The command to create the table was written as :
Create table FLIGHTS( FL_NO integer, STARTING char(20), ENDING char(30), NO_FLIGHT integer, NO_
STOPS integer);
What is wrong with command ?
(ii) What is the cardinality of the table ?
(iii) Which functions will be used to :
(a) Display total number of flights .
(b) Display number of flights whose FL_NO starts with “IC”
(option for part (iii) only)
Write function names to :
(a) Show the average Number of stops.
(b) Show the maximum number of stops.

35. A user-defined method to open a text file ‘Author.txt” and display the lines that have even number of words.
def evenwords():
f=open(“Author.txt”)
ln=f.readlines()
for line in ln:
linex=............// Statement
if len(linex)%2==0:
print(line)
f.close()
(a) How is readline() method different from readlines() method in Python?
(b) Write the use of the reader object in csv file operations.
(c) Fill the blank as marked statement.

 EN

Install NODIA App to See the Solutions.


Click Here To Install

You might also like