0% found this document useful (0 votes)
47 views8 pages

Computer Science (083) - Set1 - 24-25

Uploaded by

jackychan56687
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)
47 views8 pages

Computer Science (083) - Set1 - 24-25

Uploaded by

jackychan56687
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

REGISTRATION NO

ALL KERALA COMMON MODEL EXAMINATION 2024 - 25


COMPUTER SCIENCE(083)
CLASS XII (2023-24)
Time Allowed : 3 hours Max Marks : 70

General Instructions:

Please check this question paper contains 37 questions. There are 10 pages
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.

Section A
(1 mark)
1 Usage of an undefined variable will raise a Value Error Exception. True or False [1]

2 Identify the output of the following code snippet;- [1]


Line = "Sahodaya$Day1 2024"
Line= Line.strip('2S4h').replace('day','%')
print(Line)

i) aho%a$Day1 20 ii) Saho%a$% 1 20


iii) Saho%a$Day1 20 iii) ho%a$Day1 2024

3 Which of the following expression evaluates to True? [1]


i) True and None or False and not True
ii) not False and None or True and False
iii) not True and True and False or None
iv) True or None and False or not True

4 Choose the right option ? [1]

Lst = ['Feel', 'Better', 'After', 'Today']


st = '*'.join(Lst)
p= st.partition('er*')
print(p[:2])

i) ('Feel*Bett', 'Aft')
ii) ('Feel*Bett', '*Aft')
iii) ('Feel*Bett', 'er*')
iv) ('Feel*Bett', 'er*',’Today’)

5 What is the output of the following code snippet? [1]


st =”Sustainable Development”
print(st[-4:4:-2])
6 Choose the command(s) which cannot change the cardinality of a table. [1]
i) Delete ii) Insert iii) Alter iv) Select

7 What will be the output of the following code- [1]


Tuple1= (3,4)
Tuple2 = Tuple1
Tuple1+= (3,4)
Tuple2*= 2
print(Tuple1 is Tuple2)

8 What does the popitem() in a dictionary do? [1]


i) It removes the pair as specified as a parameter specified in a dictionary.
ii) It removes the last pair in the dictionary and returns the pair as a tuple.
iii) It returns the last pair of the dictionary.
iv) It removes the last pair in the dictionary and returns the key.

9 Which of the following statement(s) will not cause an error. [1]


i) List1.sort().reverse() ii) sort(List1.reverse())
iii) List1.sort(reverse=True) iii) reverse(List1)

10 Write the missing statement to complete the following code: [1]


file= open(“Notes.txt”, ‘r’)
data = file.read(20)
_______________
# The above statement should display & return the position of the file pointer
file.close()

11 State True or False [1]


Finally block will be executed irrespective of whether exception occurs or not.

12 State the output of the following code:- [1]


x=15
def demo(d=x):
global x
x+=5
d*=x
print(x,d)
x=5
demo()

i) 10 150 ii) 20 300 iii) 10 50 iv) 20 150

13 Give which among the statements given below will raise an exception. [1]
dict1= { (‘pen’, ‘it01’): 200, (‘pencil’, ‘it02’): 140, (‘book’, ‘it03’) : 230 }
a) dict1.get(‘pencil’, 200) b) dict1.setdefault(‘Pen’, 210)
c) print(len(dict1)) d) print(dict1.get_keys( ))

14 What will be the output of the query : [1]


Update Product set price = price*10/100 where pname like ‘S%’;
i) Increase the price by 10% of all items where name of the product starts with
S.
ii) Reset the price of the product to its 10% where the name of the product
starts with S.
iii) Decrease the price of the product by 10% where the name of the product
starts with S.
iv) The above query will show an error.

15 The ______________ keyword will categorise the rows according to the values [1]
in a column
a) order by b) where c) group d) group by

16. Which among the following can be used to find the mean of all values present
in the quantity column.
a) avg(quantity) b) mean(quantity) c) average(quantity) d)
sum(quantity)

17. Which network device should be installed inside the system to be a part of any
network
a) NIU card b) Router c) Switch d) Modem

18. Which protocol is used to login remotely to a network.


a) PPP b) TELNET c) FTP d) HTTP

19. Which switching technique will send the message as a complete packet from
source to destination?

20. Assertion (A): Global variables must be declared outside of all functions but [1]
they should be declared as global inside the function
Reason (R): All functions need not access the global variables . Therefore it
should be declared global inside those which needs to access them
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 and R is also false

21. Assertion (A): Order by clause requires one to group the rows into a particular [1]
category.
Reason (R): Order by will arrange the rows in ascending or descending order
of the column
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
(2 marks)
22 How is (2,) different from [2]. [2]
Give an example of an operation that is possible with [2] and not possible with
(2,).

23 i) Given an example of augmented expression and chained expression in [2]


Python.
ii) Give the statement to replicate ‘Hello’ , 5 times.

24 if L1= [‘a’, ‘b’, ‘c’, ‘d’ ] [2]


i) (A)Write the statement to create a dictionary with the elements of L1 as the
key and values as 100.
OR
i) (B)Write the statement to insert an element (‘e’,’w’) into the 2nd position of the
List

ii)(A) Write the statement to sort the elements of L1 into descending order.
OR
ii) (B)Write the statement to remove the element ‘c’ from L1.

25 Identify the correct output(s) of the following code. Also write the minimum and [2]
maximum possible values for the variable r1

import random
st = ('Mango', 'Pear', 'Plum', 'Apple')
r1= random.randint(1,3)
for i in range(r1,0,-1):
print(st[i], end='$')

i) Apple$Plum$Pear$ ii) Plum$Pear iii) Pear$Plum$ iv) Pear$

26 Give an example of equi join between two tables. State the cardinality and the [2]
degree of relation of the equi join.

27 i) (A)State the constraints that can be set on a table with no duplicate values. [2]
OR
i) (B)State the constraint that should be set on table to enable referential
integrity.
ii) (A)Write the SQL command to make Roll_No as the primary key of an
existing table STUDENT.
OR
ii) (B)Write the SQL command to replace Roll_No ( which was set as the
Primary Key) of the table STUDENT with Admno as the Primary key.

28 (A)List one advantage and one disadvantage of Radio Waves transmission. [2]
OR
(B) Expand ARPANET. What is the significance of ARPANET.

Section C
(3 marks)
29 (A)Write a Python function Find() which will read a Python program file [3]
“Myfirst.py” and display the number of lines in the file which has a print function
in it.
OR
(B)Write a Python function Create() which will read a Text file ‘Text.txt’ and add
on the number of characters in each word alongside the word in the file. Finally
read the file and display the contents.
e.g. if the file has data :-
The night sky
has thousand stars

Then the file should have the following data after program execution:-
The3 night5 sky3
has3 thousand8 stars5
30 (A)Write a Python program to implement stack operation on records of faculty [3]
stored into a variable Faculty which is a dictionary :-
{ Fac_id : [Fac_Name, Dept], Fac_id: [Fac_name, Dept],………..}
i) Write a push() function which takes Fac_stack and Faculty as parameters.
Push(Fac_Stack, Faculty) function should push the names of Faculty into
Fac_Stack from the dept “Mathematics”.
ii) Write the pop(Fac_Stack) function which will pop the topmost element from
the stack and prints the element. The pop() should return “Underflow” when
there are no more elements in the stack
iii) Write the peek(Fac_Stack) function to display the top most element in the
stack.
OR
(B)Write a Python program to push all the digits present in a number into a
stack and pop out the digits one by one and display the number as digits pop
out.
Write Push() and POP() functions for the stack operation.

31 Consider the following table named SALESMEN: [3]

Write SQL queries for the following:-


(A)
i) Display the Names of salespersons whose date of joining is after 2000-01-01
and were not given bonus.
ii) Display the Names , username and bonus of the salespersons in descending
order of the salary and ascending order of DOJ
iii) Increase the salary by 10% of all except Neena Sharma and Leela Yadav

OR
(B)
i) Add a column Place of type string to the above table.
ii) Display the names, DOJ and Bonus of employees who get bonus.
iii) Display the average salary of the employees who joined between 2020-01-
01 and 2019-02-20.

Section D
(4 marks)
32 (A) [4]
i) What are run time errors? Give an example.
ii) Study the program given below and state the type of error(s) that will be
trapped (if any) while executing the following program. Also give the output.
try:
x=10
num += x
print(x)
except:
print("Num is not defined")
else:
print("Successful execution")
finally:
print("Exit")

OR
(B)
i) What are compile time errors. Give an example.
ii) Study the program given below and give the output.
try:
x="Hello Python"
num = x+ 3.82
print(num)
except NameError:
print("Name Error")
except ValueError:
print("ValueError")
except TypeError:
print("TypeError")
finally:
print("Exit")

33. a) What is the importance of newline while writing data into a csv file?
b) A CSV file Item.csv has the following data:
 Item Number
 Name of Item
 Supplier code
 Quantity
 Rate
 Date of Purchase

i) Write a function in Python Copy( SUP_CODE) which will copy the records
from Item.csv to another file copy_item.csv all those records where Supplier
code is same as SUP_CODE.

ii) Write a function in Python DEL_REC( SUP_CODE) which will delete the
records from Item.csv all those records where Supplier code is same as
SUP_CODE.

34 Study the following tables Doctor and Patient and write the SQL commands for [4]
the following:-

Table Doctor:
ID Name DEPT Gender Experience
D01 Dr. Lally Gynoecology F 20
D02 Dr. Ninan Skin M 17
D03 Dr. Harish Opthamology M 18
D04 Dr. Bimal Cardiology M 14
D05 Dr. Sophia Cardiology F 21
D06 Dr. Neena Paediatric F 19

Table : Patient

P_ID P_Name ID Ward Amount DOA


P10 Issac D02 101 2500 2024-10-11
P11 Jeremy D03 101 10000 2024-10-02
P12 Anjeline D01 102 7500 2024-09-15
P13 Nima D04 103 14500 2024-07-23
P14 Jake D06 102 5000 2024-09-16
P15 Kiran D05 104 20000 2024-10-02
i) Display the names of doctors and their respective patients in the ascending
order of names of patients.
ii) Display the number of male and female doctors in each department .
iii) Display the number of patients treated by doctors having more than 15 yrs
of experience.
iv)
(A)Display The highest amount paid by the patient in the month of October of
2024.
OR
(B) Display the details of male doctor who has the highest experience.

35 The Sports ACADEMY has stored the details of the students in the database [4]
“SPORTS” in a table called Students.
The data in the students table contains data such as:
i) Name_Student String
ii) StudentId Integer
iii) Game String
iv)Category String
v) Age Integer

Note the following to establish connectivity between Python and MySQL:

Username - root
Password - tiger
Host - localhost

Write a user defined function ADD_DATA() which accepts the values from the
user and stores the data into the table student.
Write a user defined function Connect(Name_sport) in Python to read the
content of the above file and display the Names of students, Category and Age
who have the sports Name_sport .

Section E
(5 marks)

36. Sister Mathilda runs an orphanage called ANGELS which houses female [5]]
children right from few days old to 12 yrs of age. Many people comes to her
orphanage to adopt these children. She wants to maintain the details of these
children in a file with following details.
Child_ID Integer
Name_Child String
Gender String
Date_entry Date
Adopted_Parent String ( value as NONE if no adoption)
As a programmer, you have been assigned to do the following tasks:
i) State the type of file (text, csv or binary) that you would use to store the
above data . Give your reason to support your answer.
ii) Write a function entry() to enter data into the above file as suggested by you
in (i)
iii) Write a function Adopted() to display the Name of the child along with
Adopted Parent who were adopted.
37 National Law School is setting up its offices at Jaipur and planning to set up a [5]
network. The university has 3 academic schools and one administration centre
as shown in the diagram below:
The National Law school also would
like to set up a connection with their
head office at Delhi which is 600
kms from there.

Center to center distances between various buildings is as follows:

Number of Computers in each of the Schools/Center is as follows:

1. Suggest the most suitable place (i.e., Schools/Center) to install the


server of this school with a suitable reason.
2. Suggest the most efficient connecting cable medium for connecting the
machines within each centre in Jaipur.
3. Draw the cable layout for connecting the buildings in Jaipur. Also specify
the hardware device that needs to be placed inside each building to
connect the machines.
4. Should you place a repeater in your network in Jaipur. If yes or no,
justify your answer
5. (A)How would you enable a visual communication between Delhi and
Jaipur branches. What option would you opt for :-
i) Email ii) Video Conferencing iii) Telephony iv) SMS
or
(B) Which type of network is formed between the office of Jaipur and
Delhi .

*************************************************************************************************

You might also like