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/08 Set ~ 8
Roll No. Q.P Code 15/8/8
Candidates must write the Q.P Code
on the title page of the answer-book.
Please check that this question paper contains 07 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]
You can combine a numeric value and a string by using the + symbol.
2. Which of the following join gives the intersection of two tables? [1]
a) Inner join b) Outer join
c) Equi join d) Fuller join
3. Which of the given point is false regarding SQL? [1]
a) SQL is portable(work on any machine i.e PC, mainframe b) SQL has high speed(can query large volumes of data)
etc.)
c) SQL can be used with any DBMS d) SQL can not work with relational databases
4. What is the area of memory called, which stores the parameters and local variables of a function call? [1]
a) an array b) storage area
c) a stack d) a heap
5. What is the difference between (30) and (30,)? [1]
6. TV Remote uses which of the wireless transmission media? [1]
a) Infrared b) Microwaves
c) Radiowaves d) Satellite
7. Which of the following is not a valid mode to open a file? [1]
a) rw b) r+
c) ab d) wb+
8. To reflect the changes made in the database permanently, you need to run <connection>. ________ method. [1]
a) done() b) reflect()
c) commit() d) final()
9. 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
10. What is the use of mkdir() method? [1]
11. State true or false: [1]
The clear() removes all the elements of a dictionary and also deletes the dictionary.
12. The insertion operation in the stack is called ________. [1]
a) push b) insert
c) top d) pop
13. Give the SQL statement to create a table Student with Roll Number, Name, Age and Marks. [1]
14. Every network interface card (NIC) comes with its own ________ address. [1]
a) Internet Protocol (IP) b) Open Systems Interconnection (OSI)
c) Dynamic Host Configuration Protocol (DHCP) d) Physical (MAC)
15. What is the most appropriate reason to use polymorphism? [1]
a) It provides a more elegant design to program and makes it b) There is less code to write
easier to maintain and update
c) Program code takes up less space d) It makes the programmer to think at abstract level
16. Which of the following operators will return either True or False? [1]
a) += b) =
c) != d) *=
17. The checksum of 0000 and 0000 is ________. [1]
a) 1110 b) 0111
c) 1111 d) 0000
18. SMTP stands for? [1]
a) Standard Mail Transfer Protocol b) Simple Mail Transfer Protocol
c) Simple Message Transfer Protocol d) Standard Message Transfer Protocol
19. Assertion (A): We can declare multiple exceptions in except statement. [1]
Reason (R): The try block may contain the statements which throw different type of exceptions.
a) Both A and R are true and R is the correct explanation of A. b) Both A and R are true but R is not the correct explanation of
A.
c) A is true but R is false. d) A is false but R is true.
20. Assertion (A): By using open() we create an empty file. [1]
Reason (R): By using "x" access mode we can open a file, returns an error if the file exists.
a) Both A and R are true and R is the correct explanation of A. b) Both A and R are true but R is not the correct explanation of
A.
c) A is true but R is false. d) A is false but R is true.
21. Assertion (A): The def keyword, along with the function name is used to define the function. [1]
Reason (R): A function can have more than one return statement.
a) Both A and R are true and R is the correct explanation of A. b) Both A and R are true but R is not the correct explanation of
A.
c) A is true but R is false. d) A is false but R is true.
Section B
22. Define the following terms: [2]
i. Amplitude modulation
ii. Frequency modulation
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. To enter a character and print whether a given character is an alphabet, digit or any character. [2]
OR
Write a program to swap the values of two variables.
25. Which data will get added in table Company by following code? [2]
import mysql.connector
con = mysql.connector.connect(host = "localhost”,user = "system”,passwd = "hello”,database = "connect”)
cur = con.cursor()
sql = "insert into Company(Name, Dept, Salary) values (%s, %s, %s)"
val = ("ABC", "DBA", 35000)
cur.execute(sql, val)
con.commit()
26. Define the update() method with its syntax. [2]
OR
Write a program to obtain length, breadth and height of a cuboid and calculate its volume.
27. Write a function to count the number of lines starting with a digit in a text file "Diary.txt". [2]
OR
What do you understand by
i. stdin
ii. stdout
iii. stderr?
28. Spot the errors and rewrite the corrected codes. [2]
Total=0;
def sum(arg1, arg2):
total= arg1+arg2;
print "Total:", total
return total;
sum (10,20);
print "Total:" total
Section C
29. Write a method in Python to find and display the prime number between 2 to n. Pass n as an argument to the method. [3]
OR
Write a function that takes a number n and then returns a randomly generated number having exactly n digits (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.
30. Write a query on the Salespeople table, whose output will exclude all salespeople with a rating >= 100, unless they are located in Delhi. [3]
OR
Charu has to create a database named MYEARTH in MySQL.
She now needs to create a table named CITY in the database to store the records of various cities across the globe. The table CITY has the following
structure.
Table: CITY
Field Name Data Type Remarks
CITYCODE CHAR(5) Primary Key
CITYNAME CHAR (30)
SIZE INTEGER
AVGTEMP INTEGER
POPULATIONRATE INTEGER
POPULATION INTEGER
Help her to complete the task by suggesting appropriate SQL commands.
31. Write a function that receives two tuples and creates a third that contains all elements of the first followed by all elements of the second. [3]
OR
Write definition of a method OddSum(NUMBERS) to add those values in the list of NUMBERS, which are not even.
Section D
32. A line of text is read from the input terminal into a stack. Write a program to output the string in the reverse order, each character appearing twice. [4]
(ie.g., the string a b c d e should be changed to ee dd cc bb aa)
OR
Each node of a STACK contains the following information :
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.
33. A file Answer.txt contains the text. Write a program to remove all the lines that contain the character 'a' in this file and write other lines into another file. [4]
Letter 'a' is a wonderful letter.
It is impossible to think of a sentence without it.
We know this will never occur.
How mediocre our world would be without this single most powerful letter.
34. Consider the following tables SCHOOL and ADMIN and answer this question: [4]
TABLE: SCHOOL
CODE TEACHER SUBJECT DOJ PERIODS EXPERIENCE
1001 RAVI SHANKAR ENGLISH 12/3/2000 24 10
1009 PRIYA RAI PHYSICS 03/09/1998 26 12
1203 LIS ANAND ENGLISH 09/04/2000 27 5
1045 YASHRAJ MATHS 24/8/2000 24 15
1123 GANAN PHYSICS 16/7/1999 28 3
1167 HARISHB CHEMISTRY 19/10/1999 27 5
1215 UMESH PHYSICS 11/05/1998 22 16
TABLE: ADMIN
CODE GENDER DESIGNATION
1001 MALE VICE PRINCIPAL
1009 FEMALE COORDINATOR
1203 FEMALE COORDINATOR
1045 MALE HOD
1123 MALE SENIOR TEACHER
1167 MALE SENIOR TEACHER
1215 MALE HOD
Give the output of the following SQL queries:
i. Select Designation Count (*) From Admin Group By Designation Having Count (*) <2;
ii. SELECT max (EXPERIENCE) FROM SCHOOL;
iii. SELECT TEACHER FROM SCHOOL WHERE EXPERIENCE >12 ORDER BY TEACHER;
iv. SELECT COUNT (*), GENDER FROM ADMIN GROUP BY GENDER;
OR
Consider the following table GARMENT. Write SQL commands for the following statements.
Table: GARMENT
GCODE Description Price FCODE READY DATE
10023 PENCIL SKIRT 1150 F03 19-DEC-08 j
10001 FORMAL SHIRT 1250 F01 12-JAN-08
10012 INFORMAL SHIRT 1550 F02 06-JUN-08
10024 BABY TOP 750 F03 07-APR-07
10090 TULIP SKIRT 850 F02 31-MAR-07
10019 EVENING GOWN 850 F03. 06JUN-08
10009 INFORMAL PANT 1500 F02 20OCT-08
10017 FORMAL PANT 1350 F01 09-MAR-08
10020 FROCK 850 F04 09-SEP-07
10089 SLACKS 750 F03 31OCT-08
i. To display GCODE and DESCRIPTION of each GARMENT in descending order of GCODE.
ii. To display the details of all the GARMENTS, which have READY DATE in between 08-DEC-07 and 16-JUN-08 (inclusive of both the dates).
iii. To display the average PRICE of all the GARMENTS, which are made up of FABRIC with FCODE as F03.
iv. To display FABRIC wise highest and lowest price of GARMENTS from GARMENT table. (Display FCODE of each GARMENT along with highest and
lowest price)
35. Here is a table Club [4]
Memberld MemberName Address Age Fee
M001 Sumit New Delhi 20 2000
M002 Nisha Gurgaon 19 3500
M003 Niharika New Delhi 21 2100
M004 Sachin Faridabad 18 3500
Write the Python code for the following
i. Update the Address of member whose Memberld is M003 with Noida.
ii. Delete the record of those member whose name is Sachin.
Section E
36. Freshminds University of India is starting its first campus in Anna Nagar of South India with its centre admission office in Kolkata. The university has [5]
three major blocks comprising of Office block, Science block and Commerce block is in 5 km area campus.
As a network expert, you need to suggest the network plan as per (i) to (v) to the authorities keeping in mind the distance and other given parameters.
Expected wire distance between various locations
Office Block to Science Block 90 m
Office Block to Commerce Block 80 m
Science Block to Commerce Block 15 m
Kolkata Admission Office to Anna Nagar Campus 450 km
Expected number of computers to be installed at various locations in the university are as follows:
Office Block 10
Science Block 140
Commerce Block 30
Kolkata Admission Office 8
i. Suggest the authorities, the cable layout amongst various blocks inside university campus for connecting the blocks.
ii. Suggest the most suitable place (i.e. block) to house the server for this university with a suitable reason.
iii. Suggest an efficient device form the following to be installed in each of the block to connect all the computers.
a. Modem
b. Switch
c. Gateway
iv. Suggest the most suitable (very high speed) service to provide data connectivity between admission office located in Kolkata and the campus located
in Anna Nagar form the following options:
Telephone line
Fixedline dial-up connection
Co-axial cable network
GSM
Leased line
Satellite connection.
v. University is planning to connect its campus in Kolkata which is more than 100 km. Which type of network will be formed?
37. Consider the following tables CARDEN and CUSTOMER and answer (b) and (c) parts of this question: [5]
Table: CARDEN
Ccode CarName Make Colour Capacity Charges
501 A-Star Suzuki RED 3 14
503 Indigo Tata SILVER 3 12
502 Innova Toyota WHITE 7 15
509 SX4 Suzuki SILVER 4 14
510 C Class Mercedes RED 4 35
Table: CUSTOMER
Code Cname Ccode
1001 Hemant Sahu 501
1002 Raj Lai 509
1003 Feroza Shah 503
1004 Ketan Dhal 502
a. Give a suitable example of a table with sample data and illustrate Primary and Alternate Keys in it.
b. Write SQL commands for the following statements:
a. To display the names of all the silver-colored cars.
b. To display names of car, make and capacity of cars in descending order of their sitting capacity.
c. To display the highest charges at which a vehicle can be hired from CARDEN.
d. To display the customer name and the corresponding name of the cars hired by them.
c. Give the output of the following SQL queries:
i. SELECT COUNT(DISTINCT Make)FROM CARDEN;
ii. SELECT MAX(Charges), MIN(Charges) FROM CARDEN;
iii. SELECT COUNT(*), Make FROM CARDEN;
iv. SELECT CarName FROM CARDEN WHERE Capacity=4;
OR
Write the SQL commands for (i) to (v) on the basis of the table HOSPITAL
TABLE: HOSPITAL
No. Name Age Department Dateofadm Charges Sex
1 Sandeep 65 Surgery 23/02/98 300 M
2 Ravina 24 Orthopaedic 20/01/98 200 F
3 Karan 45 Orthopaedic 19/02/98 200 M
4 Tarun 12 Surgery 01/01/98 300 M
5 Zubin 36 ENT 12/01/98 250 M
6 Ketaki 16 ENT 24/02/98 300 F
7 Ankita 29 Cardiology 20/02/98 800 F
8 Zareen 45 Gynaecology 22/02/98 300 F
9 Kush 19 Cardiology 13/01/98 800 M
10 Shailya 31 Nuclear Medicine 19/02/98 400 M
i. To show all information about the patients of Cardiology Department.
ii. To list the name of female patients, who are in Orthopaedic Department.
iii. To list names of all patients with their date of admission in ascending order.
iv. To display Patient’s Name, Charges, Age for male patients only.
v. To display name of doctor are older than 30 years and charges for consultation fee is more than 500.