0% found this document useful (0 votes)
129 views7 pages

12 - CSC - Rev Ii

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)
129 views7 pages

12 - CSC - Rev Ii

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

REVISION EXAM - II (2024-25)

CLASS : XII MAX. MARKS: 70


SUBJEC : COMPUTER SCIENCE DURATION: 3 HRS
 This question paper contains 35 questions in 7 pages.
 All questions are mandatory.
SECTION - A
1 Which of the following is a keyword in Python? 1
a) true b) For c) pre-board d) False
2 What will be the output for the following Python statement? print(20//3*2+(35//7.0)) 1
a) 17.0 b) 17 c) 8.5 d) 8
3 In MYSQL database, if a table, BOOK has degree 8 and cardinality 7, and another 1
table, SALE has degree 4 and cardinality 7, what will be the degree and cardinality of
the Cartesian product of BOOK and SALE ?
a) 32 , 49 b) 12, 49 c) 12 ,14 d) 32,14
4 What is “ C “ in TCP/IP ? 1
a) Common b) Centre c)Control d) Coordinate
5 What is printed by the following statements? 1
ANIMAL={"dog":10,"tiger":5,"elephant":15,"Cow":3}
print("Tiger" not in ANIMAL)
a) True b)False c)Error d) None
6 Consider the following statements and choose the correct output from the given 1
options :
EXAM="COMPUTER SCIENCE"
print(EXAM[:12:-2])
a) EN b) CI c)SCIENCE d) ENCE
7 What will be the output of the following code ? 1
Tuple1=(10,)
Tuple2=Tuple1*2
print(Tuple2)
a) 20 b) (20,) c) (10,10) d) Error
8 The SQL keyword ___________is used in SQL expression to select records based 1

on condition/criteria.
9 What possible outcome will be produced when the following code is executed? 1
import random
value=random.randint(0,3)
fruit=["APPLE","ORANGE","MANGO","GRAPE"]
for i in range(value):
print(fruit[i],end='##')
print()
a) APPLE## b) APPLE#
ORANGE##

12 Computer Science Revision Exam-2 1


22iiExamExamination II
c) APPLE## d) ORANGE##
ORANGE## MANGO##
APPLE##
10 Select the network device from the following, which connects, networks with different 1
protocols
a) Bridge b)Gateway c)Hub d) Router
11 State whether the following statement is TRUE or FALSE : 1
The value of the expression 4/3*(2-1) and 4/(3*(2-1)) is the same
12 In the relational models , cardinality actually refers to -------------- 1
a) Number of tuples b) Number of attributes
c) Number of tables d) Number of constraints
13 Data structure STACK is also known as ----------- list 1
a)First In First Out b) First In Last Out
c)Last In First Out d) Last In Last Out
14 Which function is used to write a list of strings in a file? 1
a) writeline( ) b) writelines( ) c) write() d) writeall( )
15 Which of the following is NOT a guided communication medium? 1
a) Twisted pair cable b) Microwave
c) Coaxial cable d) Optical fibre
16 Which of the following function header is correct? 1
a) def fun(a=1,b): b) def fun(a=1,b,c=2):
c) def fun(a=1,b=1,c=2): d) def fun(a=1,b=1,c=2,d):
Q17 and 18 are ASSERTION AND REASONING based questions.
Mark the correct choice as
(a) Both A and R are true and R is the correct explanation for A
(b) Both A and R are true and R is not the correct explanation for A .
(c) A is True but R is False 3
(d) A is false but R is True

17 Assertion ( A): In SQL, the aggregate function avg() calculates the average 1

value on a set of values and produces a single result.

Reason ( R): The aggregate functions are used to perform some fundamental
arithmetic tasks such as min(), max(), sum() etc
18 Assertion(A): Python overwrites an existing file or creates a non- existing file 1

when we open a file with „w‟ mode.

Reason(R): a+ mode is used only for writing operations


SECTION - B

12 Computer Science Revision Exam-2 2


22iiExamExamination II
19 i) Expand the following : 2
a) SMTP
b) VoIP
ii) Give one disadvantage of Star topology
20 Rewrite the following code in Python after removing all error(s) and underline each 2
correction done in the code .
30 = num
for k in range(0,num)
IF k%4==0 :
print(k*4)
Else:
print(k+3)
21 Write a function letter_count(lst) that takes a list of string and returns a dictionary 2
where the keys are the letters from lst and the values are the number of times that
letter appears in the lst.
For example: if the passed list, lst is : lst=list(“apple”), then it should return a dictionary
as {„a‟:1,‟p‟:2,‟l‟:1,‟e‟:1}
22 Predict the output of the following code: 2
lst=[2,4,6,8,10]
for i in range(1,5):
lst[i-1]=lst[i]
for i in range(0,5):
print(lst[i],end=' ')
23 Consider the following list of elements and write Python statement to print the output of 2
each question.
elements=['apple',200,300,'red','blue','grapes']
i) print(elements[3:5])
ii) print(elements[::-1])
24 Meera got confused with DDL and DML commands. Help her to select only DML 2
command from the given list of command.
UPDATE , DROP TABLE, SELECT , CREATE TABLE , INSERT INTO,
DELETE , USE
25 Predict the output for the following Python snippet 2
def calc(p,q=3):
ans=1
for x in range(q):
ans=ans*p
return ans
power=calc(3)
print(power,'9')
power=calc(3,2)
print(power,'27')
SECTION - C
26 Predict the output of the Python code given below: 3

12 Computer Science Revision Exam-2 3


22iiExamExamination II
def calculate(str):
text=' '
x=range(len(str)-1)
for i in x:
if str[i].isupper():
text+=str[i]
elif str[i].islower():
text+=str[i+1]
else:
text+='@'
return text
start='Revision Exam'
final=calculate(start)
print(final)
27 Consider the following table DOCTOR given below and write the output of the SQL 3
Queries that follows :

i) SELECT D_NAME FROM DOCTOR WHERE GENDER=‟MALE‟ AND


EXPERIENCE=12 ;
ii) SELECT DISTINCT(D_DEPT) FROM DOCTOR ;
iii) SELECT D_NAME , EXPERIENCE FROM DOCTOR ORDER BY
EXPERIENCE
28 Write a function in Python that count the number of “can” words present in a text file 3
“DETAILS.txt” .
29 Consider the following Table “TEACHER”: 3

12 Computer Science Revision Exam-2 4


22iiExamExamination II
Based on the above table, Write SQL command for the following :
i) To show all information of teachers of Maths department
ii) To list name and department whose name starts with letter „M‟
iii) To display all details of female teacher whose salary is between 35000 and
50000
30 Thushar received a message(string) that has upper case and lower-case alphabet. He 3
want to extract all the upper case letters separately .Help him to do his task by
performing the following user defined function in Python:
a) Push the upper case alphabets in the string into a STACK
b) Pop and display the content of the stack.

For example: If the message is “All the Best for your Pre-board Examination” then the
output should be : E P B A
SECTION - D
31 Consider the table PRODUCT and CLIENT given below: 4

CLIENT

Write SQL Queries for the following:


i) Display the details of those clients whose city is DELHI
ii) Increase the Price of all Bath soap by 10
iii) Display the details of Products having the highest price
iv) Display the product name, price, client name and city with their corresponding
matching product Id.
32 A csv file "Happiness.csv" contains the data of a survey. Each record of the file 4
contains the following data:
● Name of a country
● Population of the country
● Sample Size (Number of persons who participated in the survey in that country)
● Happy (Number of persons who accepted that they were Happy)
12 Computer Science Revision Exam-2 5
22iiExamExamination II
For example, a sample record of the file may be:
[„Signiland‟, 5673000, 5000, 3426]
Write the following functions to perform the specified operations on this file:
a. Read all the data from the file in the form of a list and display all those records
for which the population is more than 5000000.
b. Count the number of records in the file
SECTION - E
33 a. What is the advantage of using with clause while opening a data file in Python? 2+3
Also write syntax of with clause.
b. A binary file EMP.DAT has the following structure:
[Emp_Id, Name, Salary]
Write a user defined function , disp_detail( ), that would read the contents of the file
EMP.DAT and display the details of those employees whose salary is below 25000.
34 Event Horizon Enterprises is an event planning organization. It is planning to set up 5
its India campus in Mumbai with its head office in Delhi. The Mumbai campus will have
four blocks/buildings - ADMIN, FOOD, MEDIA, DECORATORS. You, as a network
expert, need to suggest the best network-related solutions for them to resolve the
issues/problems mentioned in points (i) to (v), keeping in mind the distances between
various blocks/buildings and other given parameters.

Distance of Delhi Head Office from Mumbai Campus = 1500 km


Number of computers in each of the blocks/Center is as follows:

i. Suggest the most appropriate location of the server inside the MUMBAI campus.
Justify your choice.
12 Computer Science Revision Exam-2 6
22iiExamExamination II
ii. Which hardware device will you suggest to connect all the computers within
each building?
iii. Draw the cable layout to efficiently connect various buildings within the MUMBAI
campus. Which cable would you suggest for the most efficient data transfer over
the network?
iv. Is there a requirement of a repeater in the given cable layout? Why/ Why not?
v. What would be your recommendation for enabling live visual communication
between the Admin Office at the Mumbai campus and the DELHI Head Office
from the following options:
a) Video Conferencing
b) Email
c) Telephony
d) Instant Messaging
35 a. Give any two features of SQL. 1+4
b. Write the python code to read the following records from the table named
STUDENT and display only those records which have marks greater than 75:
RollNo – integer
Name – string
Clas – integer
Marks – integer
Note the following to establish connectivity between Python and MYSQL:
 Username is root
 Password is tiger
 The table exists in a MYSQL database named school.

12 Computer Science Revision Exam-2 7


22iiExamExamination II

You might also like