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/09 Set ~ 9
Roll No. Q.P Code 15/9/9
Candidates must write the Q.P Code
on the title page of the answer-book.
Please check that this question paper contains 09 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 string can be surrounded by three sets of single quotation marks or by three sets of double quotation marks.
2. Consider the following SQL statement. What type of statement is this? [1]
INSERT INTO instructor VALUES (10211, 'Shreya', 'Biology', 66000);
a) DDL b) DML
c) Procedure d) DCL
3. What is default value of host? [1]
a) localhost b) global host
c) Host d) general host
4. Which of the following functions will raise an error if the given substring is not found in the string? [1]
a) all of these b) index()
c) replace() d) find()
5. Discuss the utility and significance of Tuples, briefly. [1]
6. CDMA stands for? [1]
a) Call Division Multiple Access b) Channel Division Multiple Access
c) Cell Division Multiple Access d) Code Division Multiple Access
7. ________ method of File Input Stream class reads a byte of data from this input stream. [1]
a) Int read() b) Int read(byte[] b)
c) Void close() d) Void write()
8. What is the output of following code? [1]
l1 = [[4,1],[2,3],[3,5],[6,0.5]]
l1.sort()
print(l1)
a) [[2,3],[3,5],[4,1],[6,0.5]] b) [[2,3],[3,4],[5,6]]
c) [[0.5,1],[2,3],[3,4],[5,6]] d) [[6,0.5],[4,1],[2,3],[3,5]]
9. A relational database consists of a collection of: [1]
a) Fields b) Keys
c) Records d) Tables
10. How are following codes different from one another? [1]
i. my_file = open('poem.txt', 'r')
my_file.read()
ii. my_file = open('poem.txt', 'r')
my_file.read(100)
11. State true or false: [1]
The default values for parameters are considered only if no value is provided for that parameter in the function
call statement.
12. Which of the following name does not relate to stacks? [1]
a) FIFO lists b) LIFO lists
c) LOFI lists d) FILO lists
13. Explain the concept of Alternate Key in a Relational Database Management System with an appropriate [1]
example.
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. What is the value of the following expression? [1]
21//4 + 6/3
a) 7.33 b) 7.25
c) 7 d) 7.0
16. Which of the following functions is a valid built-in function for both list and dictionary datatype? [1]
a) len() b) items()
c) values() d) update()
17. In computer, process of superimposing the amplitude of message signal over amplitude of carrier signal is called [1]
a) modulation b) demodulation
c) amplitude modulation d) frequency modulation
18. Which multiple access technique is used by IEEE standard for wireless LAN? [1]
a) GSM b) CDMA
c) CSMA/CA d) ALOHA
19. Assertion (A): In Python, a stack can be implemented using a list. [1]
Reasoning (R): A stack is an ordered linear list of elements that works on the principle of First In First Out
(FIFO).
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 use a function from a particular module, we need to import the module. [1]
Reason (R): Import statement can be written anywhere in the program, before using a function from that
module.
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 enumerate() function takes a collection (e.g. a tuple) and returns it as an enumerate object. [1]
Reason (R): The enumerate() adds a counter as the key of the enumerated object.
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. Write an advantage and a disadvantage of using Optical fibre cable. [2]
23. Write Python code to create a table location with the following fields [2]
id id of the location
bidycode code of the building
room type of rooms
capacity capacity of the room
24. Write a Python script that traverses through an input string and prints its characters in different lines - two [2]
characters per line.
OR
Predict the output of the following code snippets?
i. arr = [1, 2, 3, 4, 5, 6]
for i in range(1, 6):
arr[i - 1] = arr[i]
for i in range(0, 6):
print(arr[i], end = " ")
ii. Numbers = [9, 18, 27, 36]
for Num in Numbers :
for N in range(1, Num%8) :
print(N, "#", end = " ")
print( )
25. Consider the following table structure of table Hospital. [2]
Hospital
Hospital_id(p)
Hospital_name
Bed_Count
Write Python code to create the above table structure.
26. Find the output [2]
i. 'python' . capitalize()
ii. max('33456')
iii. 'python'.upper()
iv. 'python'.isupper()
OR
Can non-graphic characters be used and processed in Python? How? Give examples to support your answer.
27. Write a program that reads a text file and then creates a new file where each character's case is inverted. [2]
OR
How is file open() function different from close() function?
28. Is return statement optional? Compare and comment on the following two return statements: [2]
return
return val
Section C
29. Trace the flow of execution for following programs: [3]
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.
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)
OR
Answer the questions (i) to (iv) based on the following:
class Book
{
char Bno[20];
protected:
float Price;
public:
void GetB();
void ShowB();
};
class Member
{
char Mno[20];
protected:
char Name[20];
public:
void GetM();
void ShowM();
};
class Library : public Member, private Book
{
char Lname[20];
public:
void GetL();
void ShowL();
};
void main()
{
Library L;
}
i. Which type of Inheritance out of the following is illustrated in the above example?
- Single Level Inheritance, Multilevel Inheritance, Multiple Inheritance
ii. Write the names of all the data members, which are directly accessible by the member function GetL() of class
Library.
iii. Write the names of all the member functions, which are directly accessible by the member function ShowL() of
class Library.
iv. Write the names of all the members, which are directly accessible by the object L of class Library declared in
the main() function.
30. Write a query to display the number of employees with same job. [3]
OR
What is SQL? What are the different categories of commands available in SQL?
31. Write a function that takes a number n and then returns a randomly generated number having exactly n digits [3]
(not starting with zero) e.g., if n is 2 then the function can randomly return a number 10-99 but 07, 02, etc., are
not valid two-digit numbers.
OR
Write definition of a method EvenSum(NUMBERS) to add those values in the list of NUMBERS, which are not odd.
Section D
32. Write a program to implement a stack for these book details (bookno, bookname). That is, now each item node [4]
of the stack contains two types of information -a bookno and its name. Just implement push and display
operations.
OR
Write a function to push any student's information to stack.
33. Write a program to get item details (code, description, and price) for multiple items from the user and create a [4]
csv file by writing all the item details in one go.
34. Give a suitable example of a table with sample data and illustrate Primary and Candidate Keys in it. [4]
OR
Study the following tables DOCTOR and SALARY and write SQL commands for the questions (i) to (v).
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. Display NAME of all doctors who are in MEDICINE department having more than 10 yrs 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.
v. To display the detail of doctor who have experience more than 12 years.
35. Consider the following table emp [4]
EmpNo EmpName Job Mgr Hiredate Sal DeptNo
7839 Mahesh President 17/11/01 5000 10
7698 Krishna Manager 7839 01/5/81 2600 25
7872 Anubhav Manager 7839 31/3/83 2700 30
7566 Siddhant Manager 7839 23/6/82 2650 15
7564 Arnav Asst. Manager 7698 18/7/81 1000 25
7560 Khyati Receptionist 7872 21/2/84 1000 30
Write Python code to insert 2 records with suitable data in the above table taking system date as Hiredate.
Section E
36. Explain the twisted pair cable in details. [5]
37. Write SQL queries for (i) to (vii) on the basis of table ITEMS and TRADERS: [5]
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;
OR
Consider the following table DRESS. Write SQL commands for the following statements.
Table: DRESS
D_CODE DESCRIPTION PRICE MCODE LAUNCH DATE
10001 FORMAL SHIRT 1250 M001 12-JAN-08
10020 FROCK 750 M004 09-SEP-07
10012 INFORMAL SHIRT 1450 M002 06-JUN-08
10019 EVENING GOWN 850 M003 06-JUN-08
10090 TULIP SKIRT 850 M002 31-MAR-07
10023 PENCIL SKIRT 1250 M003 19-DEC-08
10089 SLACKS 850 M003 20-OCT-08
10007 FORMAL PANT 1450 M001 09-MAR-08
10009 INFORMAL PANT 1400 M002 20-OCT-08
10024 BABY TOP 650 M003 07-APR-07
i. To display DCODE and DESCRIPTION of each dress in ascending order of DCODE.
ii. To display the details of all the dresses which have LAUNCHDATE in between 05-DEC-07 and 20-JUN-08
(inclusive of both the dates).
iii. To display the average PRICE of all the dresses which are made up of material with MCODE as M003.
iv. To display materialwise highest and lowest price of dresses from DRESS table. (Display MCODE of each dress
along with highest and lowest price)