0% found this document useful (0 votes)
85 views

XII - COMPUTER SCIENCE

Uploaded by

Rahul
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)
85 views

XII - COMPUTER SCIENCE

Uploaded by

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

Class : XII (MATHS_CSC) Marks : 70

Date : 08.12.2024 COMPUTER SCIENCE Duration : 3 hours


General Instructions

1. This question paper contains five sections, Section A to E.


2. All questions are compulsory.
3. Section A has 21 questions (1 to 21) carrying 01 mark each.
4. Section B has 07 Very Short Answer type questions (22 to 28) carrying 02 marks each.
5. Section C has 03 Short Answer type questions (29 to 31) carrying 03 marks each.
6. Section D has 04 Long Answer type questions (32 to 35) carrying 04 marks each.
7. Section E has 02 questions (36 to 37) carrying 05 marks each.
8. All programming questions are to be answered using Python Language only.
9. In case of MCQ, text of the correct answer should also be written.
SECTION-A (21*1=21Marks)
Q.No Questions Marks
1. State True or False 1
“Python can execute code even if it contains syntax errors.”
2. .Identify the output of the following code snippet: 1
text = "HELLOHELLOHELLO"
text = text.replace('HEL', '#')
print(text)
Options:
(A) #LO#LO#LO (B) #LOHELLO (C) HELLOHELLO D) ##LO#LO
3. print(True or not True and False) 1
Choose one option from the following that will be the correct output after
executing the above python expression.
a) False b) True c) or d) not

4. Given the following dictionaries 1


dict_stud = {"rno" : "53", "name" : “Rajveer Singh”}
dict_mark = {"Accts" : 87, "English" : 65}
Which statement will merge the contents of both dictionaries?
(a) dict_stud + dict_mark (b) dict_stud.add(dict_mark)
(c) dict_stud.merge(dict_mark) (d) dict_stud.update(dict_mark)
5. Consider a declaration L=(1,’Python’,’3.14’) 1
Which of the following represents the data type of L?
(a) list (b) tuple (c) dictionary (d) string
6. Given a tuple tupl=(10,20,30,40,50,60,70,80,90) 1
What will be the output of print (tupl[3:7:2])?
(a) (40,50,60,70,80) (b) (40,50,60,70) (c) [40,60] (d) (40,60)
7. When a Python function does not have return statement then what it returns? 1
(a) int (b) float (c) None (d)Give Error
8. What will the following expression be evaluated to in Python? 1
print(2**3**2)
a) 64 b) 256 c) 512 d) 32
1 | Page
9. Which of the following statement(s) would give an error after executing the 1
following code?
S="Welcome to class XII" #Statement 1
print(S) # Statement 2
S="Thank you" #Statement 3
S[0]= '@' #Statement 4
S=S+"Thank you" #Statement 5
(a) Statement 3 (b) Statement 4
(c) Statement 5 (d) Statement 4 and 5
10. Which of the following option is the correct python statement to read and display 1
the first 10 characters of a text file “Notes.txt”?
(a) F=open(‘Notes.txt’) (b) F=open(‘Notes.txt’)
print(F.load(10)) print(F.dump(10))

(c) F=open(‘Notes.txt’) (d) F=open(‘Notes.txt’)


print(F.read(10)) print(F.write(10))
11. Which Python approach is used for object serialization in handling of Binary File? 1
(a) Pickling (b) Un-pickling (c) Merging (d) None of these
12. In the given program, identify which are local and global variables? 1

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

13. Fill in the blank: 1


command is used to add a column in a table in SQL.
14. Keyword is used to obtain Non-duplicated values in a SELECT query. 1
(a) ALL (b) DISTINCT (c) SET (d) HAVING
15. Which SQL function returns the sum of values of a column of numeric type? 1
(a)total( ) (b)add( ) (c) sum( ) (d) All of these
16 Which of the following is not valid cursor function while performing database 1
operations using python. Here Mycur is the cursor object?
(a) Mycur.fetch() (b) Mycur.fetchone()
(c) Mycur.fetchmany(n) (d) Mycur.fetchall()
17. What Modem does? 1
a) Modulation (b) Demodulation
c) Both Modualtion & Demodulation (d) Not any
18. Pawan wants to transfer files and photos from laptop to his mobile. He uses Bluetooth 1
Technology to connect two devices. Which type of network will be formed in this case.
a. PAN b. LAN c. MAN d. WAN
19. Fill in the blank: 1
is the way of connecting the networking devices.

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.

28. A) List one advantage and one disadvantage of bus topology. 2


OR
B) Expand the term HTTP. What is the use of HTTP?

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.

Also write the function


calls.For example:
If the dictionary contains the following data: EventDetails
={“Marriage”:300, “Graduation Party”:1500,
“Birthday Party”:80, “Get together” :150}
The stack should contain :-
Marriage
Graduation Party
The output should be:
The count of elements in the stack is 2

line = [4, 9, 12, 6, 20]


for I in line:
for j in range(1, I%5):
print(j, '#', end="")
print()
5 | Page
SECTION-D (4*4= 16 Marks)
32 Mohan is a senior clerk in a MNC. He creates a table salary with a set of records to 1+3=4
keep ready for tax calculation. After creation of the table, he has entered data of 5
employees in the Employee table.

Based on the table given above write the SQL Queries:


A)
(i) To Display the Emp_Name and Gross_salary of each employee.
(Gross= basic+da+hra+nps)
(ii) To Increase the DA by 3% of respective basic salary of all
employees.
(iii) To Delete the Attribute emp_desig from the table.
(iv) Display the names of the employees whose gross salary is greater
than 100000.
OR
B)
(i) To display the total number of employees in Employee table.
(ii) To display the employees records in descending order of
basic_salary respectively.
(iii) To display the total hra of employees in Employee table.
(iv) Count the number of employees whose basic salary is greater than
50000.

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:

Write SQL queries for the following:


i) Display total periods subjectwise by framing groups based on subject.
ii) Display minimum experience and maximum code from relation SCHOOL.
iii)Display teachername, gender by joining both tables on the basis of code
ATTRIBUTE and the designation should be “COORDINATOR.
iv)
(A) Display the total number of different subjects in school relation.
OR
(B) To display the total number of Males and Females separately with gender in
ADMIN table.
35 4
. Aarya has created a table named Emp in MySQL:
EmpNo – integer
EmpName – string
Age– integer
Salary – integer
Note the following to establish connectivity between Python and MYSQL:
● Username - root
● Password - tiger
● Host - localhost
● The Emp table exists in a MYSQL database named company.
● The details (EmpNo, EmpName, Age and Salary) are to be accepted
from the user.
Aarya wants to display All Records of Emp relation whose age is greater than 55.
Help Aarya to write program in python
SECTION-E (2*5= 10 Marks)
36 i. What is Binary File? 1+2+
ii. Consider a binary file stock.dat that has the following data: OrderId, 2=5
MedicineName,Qty and Price of all the medicines of wellness medicos, write the
following functions:
a) AddOrder() that can input all medicine orders.
b) DisplayPrice() to display details of all medicine that have Price more than 500.

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

Shortest distances between various blocks


Block DEVELOPMENT to Block HUMANRESOURCE -- 50 m
Block DEVELOPMENT to Block ADM-- 75 m
Block DEVELOPMENT to Block LOGISTICS-- 80 m
Block HUMANRESOURCE to Block ADM-- 110 m
Block ADM to Block LOGISTICS 140 m

Number of computers installed at various blocks


Block Number of Computers
DEVELOPMENT -- 105
HUMANRESOURCE-- 130
ADM-- 190
LOGISTICS-- 55

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy