XII - COMPUTER SCIENCE
XII - COMPUTER SCIENCE
def change():
n=10
x=5
print( x)
a) n and x both are local variables b) n and x both are global variables
c) n is global and x is local variable d) n is local and x is global variable
2 | Page
Q20 and Q21 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
(d) A is false but R is True
20. Assertion (A): A variable declared as global inside a function is visible outside 1
the function with changes made to it inside the function.
Reasoning (R): global keyword is used to change the value of a global variable.
21. Assertion (A): COUNT(*) function count the number of rows in a relation. 1
Reasoning (R): DISTINCT ignores the duplicate values.
SECTION-B (7 * 2= 14 Marks)
22. How is a mutable object different from an immutable object in Python? 2
Identify one mutable object and one immutable object from the following:
{1, 2, 3}, "abc", (10, 20), {'a': 1, 'b': 2}
23. Give one example of each of the following: 1+1=2
(I) Logical operators (II) Assignment operators
24. Write the Python statement for each of the following tasks using BUILT_IN 1+1=2
functions/ methods only:
i) str="PYTHON@LANGUAGE"
(A) To print the above string from index 2 onwards.
OR
(B) To initialize an empty dictionary named as d.
ii) Write the Python statement for each of the following tasks using BUILT_IN
functions/ methods only:
(A) s=”LANGUAGE"
To convert the above string into list.
OR
(B) To initialize an empty tuple named as t.
25. Identify the correct outputs from the following code?Also specify the minimum and 2
maximum possible values of variables b.
import random
text = "Python"
x = random.randint(2, 7)
for i in range(1, x, 2):
print(text[i], end='@')
(a) y (b) y@h
(c) y@h@n@ (d) y@h@i@
26. Differentiate between COUNT(* ) and COUNT(COLUMN_NAME) with example. 2
3 | Page
27. I A) What constraint should be applied on a table column so that duplicate values are 2
not allowed in that column, but NULL is allowed.
OR
B) What constraint should be applied on a table column so that NULL is not allowed
in that column, but duplicate values are allowed.
I Write an SQL command to remove the Primary Key constraint from a table, named
MOBILE. M_ID is the primary key of the table.
OR
Write an SQL command to make the column M_ID the Primary Key of an already
existing table, named MOBILE.
4 | Page
30. A) 3
A stack named CustomerStack contains customer records. Each record is
represented as a list containing customer_name, customer_id, and
purchase_amount.
Write the following Python functions to perform stack operations:
push_customer(CustomerStack, new_customer): This function takes the stack
CustomerStack and a new customer record new_customer as arguments and
pushes the new record onto the stack.
pop_customer(CustomerStack): This function pops the topmost customer record
from the stack and returns it. If the stack is empty, it should display "Underflow".
peep_customer(CustomerStack): This function displays the topmost customer
record without removing it. If the stack is empty, it should display "None".
OR
B)
Write a function in Python push(EventDetails) where EventDetails is a dictionary
containing the number of persons attending the events–
{EventName : NumberOfPersons}.
The function should push the names of those events in the stack named
‘BigEvents’which have number of persons greater than 200. Also display the count
of elementspushed on to the stack.
Write the function pop(EventDetails) that removes the top element of the stack
on its each call.
33 A CSV file, "HealthSurvey.csv", contains the data collected during a health survey. 2+2=4
. Each record of the file contains the following details:
Name of the individual
Age of the individual
BMI (Body Mass Index) of the individual
Exercise Hours (Average hours of exercise per week)
For example, a sample record of the file may be:
['John Doe', 35, 24.5, 6.5]
Write the following Python functions to perform the specified operations on this file:
(I) Read all the data from the file and display all records for individuals who
exercise for more than 5 hours per week.
(II) Count and display the total number of individuals in the file.
6 | Page
34 Write the SQL queries (i) to (iv) based on the relations SCHOOL and ADMIN given 4
. below:
7 | Page
37 Hitech Info Limited wants to set up their computer network in Bangalore 5
based
campus having four buildings. Each block has a number of computers
that are required to be connected for ease of communication, resource sharing and
data security.
You as a network expert have to suggest answers to these parts (a) to (e) raised
by them.
DEVELOPMENT HUMANRESOURCE
LOGISTICS ADM
i) Suggest the most suitable block to host the server. Justify your answer.
ii) Suggest the wired medium and Draw the cable layout (Block to Block) to
economically connect various blocks.
iii) Suggest the placement of the following devices with justification:
(a) Hub/Switch (b)Repeater
iv) Suggest the device that should be placed in the Server building so that they
can connect to Internet Service Provider to avail Internet Services.
v) A) What is the Suggestion for the high-speed wired communication medium
between Bangalore Campus and Mysore campus to establish a data network.
(a) TWP Cable (b)CoAxial Cable (c) Optical Fibre Cable (d) UTP Cable
OR
B) What type of network (PAN/ LAN/ MAN/ WAN) will be set up among the
computers connected in the Campus?
Page:1/5