CS Sample Paper 11-14
CS Sample Paper 11-14
SAMPLE
QUESTION PAPER 11
Computer Science
Instructions Time : 3 hrs Max.Marks
70
SectionA
1. State True or False
"Adictionary is immutable."
2. Which character is used to specify a multiline comment?
(ii)
(iii) pri :4]) (iv) print(tup1C-4:])
(b) ii, iv (c) ii, v
6. The method places the file pointer (d) i, iii
(a) read() to a specific position
(b) write() (c) writeline() in the file.
(d) seek()
Sample Paper 11
Isvcceed
o stage111
Excellence Levell 155
l. Constraintsare
(a) fields (b) tuples
(c)conditions [11
g which of the following category
of SQL
commands are used
(c) DDL
to create Schema objects? [11
9. The clause is used to
specify the
(a) end separator character
in a print statement [1]
(c) delim
10, A table is also called a (d)part
(a) field (b) relation
(c) attribute [1]
Fill in the blank : In the statement (d)key
f.write( ) , what can be the contents
(a) List (b) String of the blank?
(c) Dictionary [1]
(d) File
12. In the statement, SELECT * FROM
Emp GROUP BY
(a)Afield The blank can be [1]
(c) A Primary key field only (b) A record
(d) A value
13. State whether the following
statement is True or False. A
repeater is a transmission media. [1]
14. Find the output of the following code
num=123 [1]
> 3):
while(num
rem — num % 100
if (rem % 2 !
f + rem
s + rem
num / —100
print(f-s)
(a) 22 (b) 23 (c) 32 (d) Error
15. Amodem is connected in between a telephone line and a
[1]
16. It is a method of exchanging digital messages from sender to one or more recipients. [IJ
(a) Electronic messages (b) Electronic mail (c) Both (a) and (b) (d) None of these
DirectionsIn the question numbers 17 and 18, a statement ofAssertion (A) is followed by a statement ofReason
(R).Choosethe correct option.
17. Assertion (A) To read all lines from a text file a list type data structure is required [11
Reason (R) The readlines() function returns each line of a file as a list item.
(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 ü•ue but R is false.
(d) A is false but R is true.
and writing in Binary files.
18• Assertion (A) Python supports simultaneous reading
reading and writing.
Reason (R) The rb+ and wb+ modes allow both
explanation for A.
(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
(c) A is u•ue but R is false.
(d) A is false but R is true.
Computer Science Class
12
156 ExcellenqeLev
Section B [1+1Q]
19. (i) Write a short note on protocol.
(ii) Write names of two protocols. small pans,
for dividing a file or message into very
or (i) Which part ofTCP/1P is responsible
topology in which there are bi-directional links between
(ii) Which is the name of the network
each possible node?
after removing the syntactical error(s), if any. Underlineeach
20. Rewrite the following program
correction
mul=3
value—IO
for i in range(1, 6, 1):
if (value %mul
print (value * multiply)
Write SQL queries for statements (i) to (iii), with respect to the tables ACCESSORIESand
SHOPPE given above.
(i) To display Name and Price of all the Accessories in ascending order of their Price.
(ii) To display Id and SName of all Shoppe located in Nehru Place.
(iii)To display Minimum and Maximum Price of each Name of Accessories.
27. Write a definition of function that opens a file "output.txt" and find the frequency of the word
that is passed as parameter to the function in each line of the file. Now write each line number
and the frequency of the word in each line to a new file. [3]
> "2009-12-01";
(i) SELECT SUM(Qty) FROMSTORE WHERELastBuy " %classic",
(ii) SELECT FROMSTORE WHEREITEM LIKE
(iii) SELECT MAX(LastBuy) FROMSTORE;
contains unique keys and values.
29. Write a program in Python to check whether a dictionary
Example :
Output :
Values are not Unique.
30. Write a user-defined function PushNames(n) that takes input a list of countries and pushesonly
those names into a stack,which are present in the list
• Section D
31. Consider the followingtable PRODUCTS:
Table : PRODUCTS
Code IName Price Company TCode
1001 DIGITAL PAD 121 120 11000 XENITA TOI
1006 LED SCREEN 40 70 38000 SANTORA T02
1004 CAR GPS SYSTEM 50 2150 GEOKNOW TOI
1003 DIGITAL CAMERA 160 DIGICLICK T02
1005 PEN DRIVE 32 GB 1200 STOREHOME T03
ADMIN
BUSINESS
MEDIA
(i) Suggest the most appropriate location of the server inside the Nepal Campus (out of 4
buildings), to get the best connectivity for maximum number of computers. Justify your
answer.
(ii) Suggest and draw the cable layout to efficiently connect various buildings within the Nepal
Campus for connecting the computers.
(iii) Which hardware device will you suggest to be procured by the company to be installed to
protect and control the Internet uses within the campus.
(iv) Which of the following will you suggest to establish the online face-to-face communication
between the people in the ADMIN office of Nepal Campus and Mumbai Head Office?
(a) Cable TV (b) E-mail
(c) Video Conferencing (d) Text Chat
(v) Expand the following
(b) PAN
(a) MAN
Computer Science Class
160 stage111
Excellence 12
Answers
I. False
10. (b) 11. (b) 12. (a) QR
13. False 14.(b) 15. computer 16.(b) 17. (d) 18. (a)
SAMPLE
OUESTION PAPER 12
Computer Science
q A (_xvw•sts
c' c•nes
question. 2 Marks
quest"HIS V carnes Marks
t c•wsts c' s' cures 4 Muns
L ctnssts questions carnes S Marks
N •etc •niy
•%ction A
Py%iu.o bc
u' a '
S. L.AL.•uuaeti.E
R.n
4. Much (d) AND
NOT
u u• tik. lil
a
(b).nLd)
uwbb•'haauwi
7• Whichtransmission
Computer Science Class12
162 •staged' ExcellenceLeve(d
on the 2G and
oriented mobile data service
8. Which of the following technology is a packet
cellular communication? (d) GSM
(b) GPRS (c) WLL
(a) CDMA
snippet?
9. What is the output of the following code
def test(a):
for i in a:
print(i)
(d) None of these
(a) 3 45 3 7 4
5
3
7
14. Evaluate the following expression and identify the correct answer.
16-(4 + 2) + *4
(a) 54 (b) 46 (c) 18 (d) 32
'Section B
19. (i) Compare Star and Bus topologies.
(ii) It is a method of exchanging [1+1=2]
digital messages from sender
to one or more recipients.
(i) What can be possible the drawback of
E-mails?
(ii) What is used to translate domain name
into IP address?
20. What is the output of following code?
def test(): [2]
a=96
print(a)
test()
21. What will be the output of following Python code?
[2]
str1="6"
for i in list 1:
strl=strl+i
print(strl)
Or
How many times will the given loop iterate?
print ("Python")
22. Writethe syntax of ALTERcommand along with the clauses used with it. [21
Or
Charu has to create a database named MYEARTHin MySQL.
She now needs to create a table named CITYin the database to store the records of various cities
across the globe. The table CITYhas the following structure.
Table : CITY
tup=tup1*2
print(tup)
Or
What will be the output of the following Python code?
x-CI, 3, 6, [18]]
y=list(x)
print(y)
removing the syntactical errors (if any). Underline each
25. Rewrite the following code after
correction.
def chksum:
x = input ("Enter a number")
if x %2=0.
for i range (2 * x) :
print(i)
loop else:
print ("4k")
Section C
26. Consider the following tables STUDENTand STREAM.
Table : STUDENT
SCODE NAME AGE STRCDE POINTS GRADE
101 Amit 16 1 6 NULL
102 Arjun 13 3 4 NULL
103 Zaheer 14 2 1 NULL
105 Gagan 15 5 2 NULL
108 Kumar 13 6 8 NULL
109 Rajesh 17 5 8 NULL
110 Naveen 13 3 9 NULL
113 Ajay 16 2 3 NULL
115 Kapil 14 3 2 NULL
120 Gurdeep 15 2 6 NULL
Table : STREAM
STRCDE STRNAME
1 SCIENCE+COMP
2 SCIENCE+BIO
3 SCIENCE+ECO
4 COMMERCE+MATHS
5 COMMERCE+SOCIO
6 ARTS+MATHS
7 ARTS+SOCIO
Sample Paper 12 Excellence Leve
OStage111 165
ced
a user-defined function
data of Kids . Write
30. Sunita has created a nested list : "KidsData" ,storing the details in the list and pushes them
The function checks
PushKids() with the list as parameter.
to the list , only if the kids are of "Nursery"
List Structure :
KidsData : [[KidID , Kidname , Age, Grade]]
Section D
[1 41
31. Consider the followingtable FOOD:
Table : FOOD
Brand Price
Did Dname
Coca-Cola 45
DOI Black Masala
Pepsi 55
Sweet Mango
Maaza 75
Instant Energy
Coca-Cola NULL
Roman Blue
Coca-Cola 85
Green Drink
Section E
33. Learn Togetheris an educationalNGO.It is setting up its new campus at Jabalpur forits
web-based activities. The campus has four compounds as shown in the diagram below:
[1 x 5=51
Resource Main
Compou pou
Training Finance
Compoun Compound
Centre to centre distance between various compounds as per architectural drawing (in m)isas
follows
Main Compound to Resource Compound
110m
Main Compound to Training Compound
115m
Main Compound to Finance Compound
35 m
Resource Compound to Training Compound
25 m
Resource Compound to Finance Compound
135m
Training Compound to Finance Compound
100m
d Sample Paper 12 Excellence Level
•stage 111 167
sgccee
i
34. (i) In a multiplex, movies are screened in different auditoriums. One movie can be shown in
more than one auditorium. In order to maintain the record of movies, the multiplex
maintains a relational database consisting of two relations viz. CINEMAand PEOPLE
respectively as shown below: [1+4= 5]
MovieName, ReleaseDate)
PEOPLE(AudiNo, Movie ID, Seats, ScreenType, TicketPrice)
then
Is it correct to assign Movie_IDas the primary key in the CINEMArelation? If no,
suggest an appropriate primary key.
Books •
(ii)Consider the table Books of following structure storing the details of
BookNo Author Publisher NoPages
Rohini BPB 450(Sample record)
books.
Write a Python code to update the publisher to "Arihant"for all
Database : BookDB
Host : localhost
Username : mysql
Password : book
Or
database EMP DEPENDENTto maintain following
(i)An organisation wants to create a
dependent.
details about its employees and their
Department,EmployeeID)
EMPLOYEE(AadharNumber, Name, Address,
Relationship)
DEPENDENT(EmployeeID, DependentName,
the table Patient storing details of patients as per following structure :
(ii) Consider Days
PNAME DEPT
PATID 5 (Sample record)
POI Sumit Ortho
Python code to add a column name Ward Varchar (15)
Write a
Database : BookDB
Host : localhost
Username : mysql
Password : book
168 StggelßExcellence Lev Computer Science Class
12
Answers
1. True
Solution scan QR code
10. (b) 11. (d) 12. (c)
13. (d) 14. (c) 15. (a) 16. (c) 17. (b) 18. (a)
Proficiency Building Zone
O Stage Ill Excellence Level
(Without Solutions)
SAMPLE
QUESTION PAPER 13
ComputerScience
Instructions Time : 3 hrs Max. Marks : 70
1Section A
[11
1. State True or False.
"Alist is immutable".
[1]
2. range(2,12) returns numbers from
(a) Ito 12 (b) 2 to 11 (c) 2 to 12 (d) None of these
[1]
3. Invalididentifier among the following is/are
(b) _ttt (c) break (d) Both (a) and (c)
(a) 123abc
5. Adictionary is ordered by
(c) Both (d) Not ordered
(a) keys (b) values
file.
6. The object is used to read data from a CSV
(c) load (d) readall
(a)reader (b) read
network is called
7• Geometric arrangement of devices on the
(c) media (d) LAN
(a)topology (b) protocols
Computer Science Class
170 Excellence Leveli
Astage 111
matching patterns.
characters for
8. The LIKE clause uses
sectionB
how star topology is better in terms of fault detection. [1+1
19. i) State
(ii) In which topology, every node is connected to two other nodes?
Or
(i)Which guided media provides secure transmission amongst all of them?
(i) Arrangethe following network in ascending order of their area:
LAN, PAN, WAN, MAN
[2]
output of the following Python code?
20.Whatwill be the
x— C'ab', 'cd']
for i in x:
i. upper()
print(x)
[2]
Python code?
2L Whatwill be the output of the following
num=
= 18
= 16
= 22
for i in num:
sum+ = numCi]
print(len(num) + sum)
Or
Identifythe error and write the correct code.
60-a
while (a>50)
print(a)
a=a+10
with example to explain it. [2]
22' Writethe syntax of UPDATEcommand along
Or
Define its types.
Whatdo you mean by data independence?
23.How to traverse a string using for loop?
calculate the sum and mean of the elements which are entered by user. [2]
24' Writea program to
Or
Python code snippet?
Whatwill be the output of the following
for i in range(len(x)):
print(x)
Computer Science Class
12
Section C
26. Consider the two tables given below :
Table : Student
Marks AddresslD
RollNo Name Class
12ScA 78.5
1 Rohan A2
11ComC 67.7
2 Smita A3
p riya 12HumA 82.6
3
Table : Address
State Contact
AddresslD Place
Delhi 9876745655
Pahargunj
WB 9434566778
A2 Kolkata
Punjab 9433534038
Barnala
the table Student and Address.
Write SQL queries for statements (i) to (iii), with respect to
for Students whose Name
(i) Display Student names, corresponding Places and AddressIDs
ends with "a".
(ii) Increase marks of students by 5.5 who belong to state of "Delhi"
(iii) Delete records of students of class 12.
27. Write a definition of a function Bfileread() that receives a filename and an ID as parameter
and
displays only those records from a file "Transaction.dat" who have transaction type (TType) as
"Deposit".
Assume the following record structure of the file:
fransaction.dat
TID Amount
T05 Withdrawl 55000(Sample record)
Example :
File contents
TID TlYpe Amount
T05 Withdrawl 55000
T02 Deposit 70000
Output :
T02 Deposit 70000
Or
Write definition of a Sportsread() that receives a filename and a gamename as
parameter and displays only those records from a file "Games.dat" who have type as "Indoor
Assume the following record structure of the file:
Games.dat
SID Gamename
sol Football Outdoor
Sample Paper 13 Excellence Level
estage 111 173
i511
Example:
Filecontents
SID
Gamename Type
sol Football Outdoor
s02 Indoor
Output :
s02 Indoor
following table and find solutions for (i) to (iii).
28. Studythe
Ronitawants to store the data of some products in a table product as follows:
Table : Product
PNO PName Qty Date_Of_Mfg
POI Pencil 20 2020-09-01
PC)2 Eraser 5 1990-09-11
P03 Book 16 200C04-03
Notebook 15 2016-12-11
Color 10 2015-02-04
She also wants to perform some operations and manipulations on the table. Help her to find
the solutions of following questions.
(i)A command that displays the details of all the products.
(ii)Which command she can use to add a new column to the table?
(iii) Write the command to display the field description of the table.
29.Writea program in Python to input details of as many guests as per following structure :
GuestlD, Guestname , Type , Location . Now, create a dictionary storing GuestlD as key and
other details as list of values, for only those Guests whose name starts and ends with a vowel.
[3]
Example :
Input
GuestlD Guestname IYpe Location
Rakesh Foreign Amsterdam
Amitabha National Kolkata
Dictionarycontents:
'Amitabha',' National','Kolkata']}
30• Nabojeet has created a dictionary: "Electronics" ,storing data of electronic products. Write a
. The function checks the
user-definedfunction Pushltems() with the dictionary as parameter whose price is above 10000.
detailsin the dictionary and pushes only those items into a stack
[3]
Dictionary Structure :
:C'LCD' 15000], Player'
Electronics .
nSection D
Write MySQL commands for the statements given
31•Consider the following table PREPAID. [Ix4 —4]
below:
Model Connection
S No C_Name
1 Nokia Artel
Sita
Samsung Idea
2 Geeta
LG BSNL
3 Ritesh
Micromax Reliance
4 Jayant
Computer Science Class12
174 Stagelll Excellence Level
take NULL values.
column does not
(a) Write a command so that the Model
(b) Display all records of table Prepaid.
(c) DELETE a column name Model. type is BSNL.
where Connection
(d) DELETE a customer record with following attributes:
of departments
32. Given a file "dept.dat", containing records
Candidate: Name of the candidates Math, Biology, etc.
Computer, Physics,
Department: Department name like: the file "dept.dat" and creates a file named
contents from
Write a method copy() that would read from "dept.dat" where the department name
is
Main Resource
Building Building
Answers
I, False 90 . @
Por Solution scan QRcode
11. (a) 12. (a)
10. (b)
17. (a) 18. (a)
14. (a) 15. (b) 16. (d)
proficiency Building
O Stage Ill ExcellenceLeve
(Without Solutions
SAMPLE
QUESTION PAPER 14
Computer Science
Instructions Time : 3 hrs Max.Marks 70
1. Please check this question paper contains 35 questions.
2. The paper is divided into 5 Sections A, B, C, D and E.
3. Section A, consists of 18 questions (1 to 18). Each question carries I 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 cames 5 Marks.
8. All programming questions are to be answered using b'thon Language only.
SectionA
1. State True or False.
"The extend method extends the 1st list with the 2nd list contents."
2. The continue statement
(a) Stops the loop (b) Stops the current iteration
(c) Stops the program execution (d) None of these
3. Invalid keyword among the following is
(a) break (b) for (c) while (d)jump
4. x=2
y=-2
x ** y returns
(a) 0.25 (b) 0.5 (c) Error
5. A dictionary can have maximum
(a) 3 Keys (b) 4 keys (c)Any cf keys (d) None of these
6. The function creates a cursor object.
(a) cursor() (b) createcursor() (c) loadO
(d)
7. The primary key constraint can be applied to
(a) one column (b) two columns (c) three colum1B
(d) many columns
Sample Paper 14
Excellence Lev
estage 111 177
character with LIKE clause
8. The matches multiple unknown characters.
(c) 45 (d) 40
Section B
19. (i) Name one commonly used open source internet browser and one commonly used open
source operating system. 11+1=21
while i > 1:
if
x=iX2
print(x)
Or Find the output of following code
print(i)
d Sample Paper 14 Excellence Level
'Stage 111 179
i5ij
MOVIEID TITLE
LANGUAGE RATING PLATFORM
MOOI Minari
Korean 5 Netflix
MGR Magan
Tamil 4 Hotstar
M010 Kaagaz Hindi 3 Zee5
MOII Harry Potter and the Chamber of Secrets
English 4 Prime Video
M015 Uri Hindi 5 Zee5
M020 Avengers: Endgame English 4 Hotstar
25. Observethe following Python code very carefully and rewrite it after removing all syntactical
errors with each correction underlined. [2]
DEF execmain ( ) :
x = input ("Enter a number")
if (abs(x) = x):
print ("You entered a positive number:")
else:
•SectionC
26. Considering the following tables :
Table : STUDENT
Class Section ProjectNo
RollNo Name
Xl 1 101
11 Mohan
Sohan Xl 2 102
12
1 103
John Xll
21
Meena Xll 2 104
22
Xll 2 103
23 Juhi
Computer Science Class12
180 E8cetlence Level
OStage 111
Table : PROJECT
Submission_Date
ProjectNo PName
12/01/2018
101 Airline Database
12/01/2018
102 Library Database
15/01/2018
103 Employee Database
12/01/2018
104 Student Database
15/01/2018
105 Inventory Database
15/01/2018
106 Railway Database
(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 GAMEI and GAME2.
29. Write a program in Python to input a sentence and a word. Now, search the word in the sentence
and add each occurrence of the word as value of a dictionary and the key as the index where
are found.
Sample Paper 14 Excellence Level*
OStage 111 181
pcceed
Example
Input : "He is such a boy who is very good in studies.
Dictionary contents :
21:'is' }
{ 3:'is',
30.Jitendrawas told by his teacher to pick certain elements from a dictionary: "Garment" and push
intoa stack selectively the garment items whose price is above
• 5000. The structure of the
dictionaryis given below [3]
Garment {'1' : 15000]}
'Section D
31.Writethe SQL commands for (a) to (d) on the basis of the table HOSPITAL.
Table: HOSPITAL
No Name Age Department Dateofadm Charges Sex
1 Sandeep 65 Surgery 23/02/98 300
2 Ravina 24 Orthopaedic 20/01/98 200
3 Karan 45 Orthopaedic 19/02/98 200
4 Tarun 12 Surgery 01/01/98 300
5 Zubin 36 ENT 12/01/98 250
6 Ketaki 16 ENT 24/02/98 300
7 Ankita 29 Cardiology 20/02/98 800
8 Zareen 45 Gynaecology 22/02/98 300
9 Kush 19 Cardiology 13/01/98 800
10 Shailya 31 Nuclear Medicine 19/02/98 400
Writethe for the following :
(a)Toget the department wise number of patients.
(b)Toget the department names that end with "ogy".
(c)Toremove all the records of the table along with the table structure.
(d)Toget the maximum charges among all
32.Writea program to show the detail of the student who scored the highest marks.
Data stored in
"Data.csv"is given below: [4]
Rollno,Name, Marks
1. Aman, 35
2. Kanak, 1
3. Anuj, 33
4.Suman, 25
nSection E
33' Eduminds University of India is starting its campus in a small town Parampur of
Central India
with its centre admission office in Delhi. The university has three major buildings
Adminbuilding, Academic building and Research building in 5 km area campus. comprising of
Computer Science Class 12
various locations
Expected wire distance between
90 m
Research Building to Admin Building
80 m
Building
Research Building to Academic
15 m
Academic Building to Admin Building
Campus 1450 km
Delhi Admission Office to Parampur
various locations in the university areas
Expected number of computers to be installed at
follows 20
Research Building
150
Academic Building
35
Admin Building
5
Delhi Admission Office
buildings inside the University
(i) Suggest the authorities, the cable layout amongst various
campus for connecting the buildings.
server of this organisations
(ii) Suggest the most suitable place (i.e. building) to house the
with a
Il
suitable reason.
each of the building to connect
(iii) Suggest an efficient device for the following to be installed in
all the computers
(a) Gateway (b) Modem (c) Switch
(iv) Suggest the most suitable (very high speed) service to provide data connectivity between
admission building located in Delhi and the campus located in Parampur from the following
options:
(a) Telephone line
(b) Fixedline dial-up connection
(c) Co-axial cable network
(d) GSM
(e) Leased line
(f) Satellite connection.
(v) University is planning to connect its campus in Delhi which is less than 100 km. Whichtype
of network will be formed?
34. (a) Write differences between equi join and cross join. [1+4=5)
(b) Consider the table Project of following structure storing the details of some ongoing
software projects.
ProjCode ProjName Team SubmissionDate
POI Electrification 105 2023-12-05(Sample data)
sample Paper 14 OStage111Excellence Leve! 183