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

Xii CS Hy 24

Class 12 CS half year ernakulam region paper 2024-25

Uploaded by

PRAMESH PATEL
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)
89 views8 pages

Xii CS Hy 24

Class 12 CS half year ernakulam region paper 2024-25

Uploaded by

PRAMESH PATEL
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

HY XII 083 2024

KENDRIYA VIDYALAYA NO 2 HAPP TRICHY


HALF YEARLY EXAMINATION– 2024-25
CLASS XII SUBJECT: COMPUTER SCIENCE(083)
MARKS 70 TIME 3 hrs
General Instructions:
● This question paper contains 37 questions.
● All questions are compulsory. However, internal choices have been provided in somequestions. 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.

Q No. Section-A (21 x 1 = 21 Marks) Marks


1. State True or False:
In Python, else: block works only with conditional statements. (1)

2. Identify the output of the following code snippet:


text = "GAME-CHANGER"
text=text.replace(‘GA’,'$')
print(text)
(A) $ME-CHANGER (B) $$ME-CHAN$ER (1)
(C) $ME-CHAN$ER (D) $AME-CHAN$ER
3. Which of the following expressions evaluates to False?
(A) not(True) and False
(B) True or False (1)
(C) not(False and True)
(D) True and not(False)
4. What is the output of the expression?
word=’interchangeable’ (1)
print(word.split("e"))
5. What will be the output of the following code snippet?
msg= "Let’s Start Today" (1)
print(msg[-2::-2])
6. If my_dict is a dictionary as defined below, then which of the following
statements will raise an exception?
my_dict = {'apple': 10, 'banana': 20, 'orange': 30}
(A) my_dict.get('orange') (1)
(B) print(my_dict['apple', 'banana'])
(C) my_dict['apple']=20
(D) print(str(my_dict))
7. What will be the output of the following code?
tuple1 = (1, 2, 3)
tuple2 = tuple1
tuple1 += (4,)
print(tuple1 == tuple2) (1)
(A) True (B) False (C) tuple1 (D) Error

8. What does the list.remove(x) method do in Python?


(A) Removes the element at index x from the list
(B) Removes the first occurrence of value x from the list (1)
(C) Removes all occurrences of value x from the list
(D) Removes the last occurrence of value x from the list

9. If a table which has one Primary key and two alternate keys. How many
Candidate keys will this table have?
(1)
(A) 1 (B) 2 (C) 3 (D) 4

10. Write the missing statement to complete the following code:


file = open("example.txt", "r")
data = file.read(100)
#Move the file pointer to the (1)
beginning of the file
next_data = file.read(50)
file.close()

11. State whether the following statement is True or False:


The finally block in Python is executed only if no exception occurs
(1)
in the try block.

12. Which SQL command can change the degree of an existing relation? (1)

13. What will be the output of the following code?


c = 10
def add():
global c
c = c + 2
print(c,end='#')
add() (1)
c=15
print(c,end='%')
(A) 12%15# (B) 15#12% (C) 12#15% (D) 12%15#

14. What will be the output of the query?


SELECT * FROM products WHERE product_name LIKE
'App%';
(A) Details of all products whose names start with 'App' (1)
(B) Details of all products whose names end with 'App'
(C) Names of all products whose names start with 'App'
(D) Names of all products whose names end with 'App'
15. In which datatype the value stored is padded with spaces to fit the specified
length. (1)
(A) DATE (B) VARCHAR (C) FLOAT (D) CHAR

16. Which aggregate function can be used to find the cardinality of a table? (1)
(A) sum() (B) count() (C) avg() (D) max()

17. Which protocol is used to transfer files over the Internet? (1)
(A) HTTP (B) FTP (C) PPP (D) HTTPS

Which network device is used to connect two networks that use different (1)
18.
protocols?
(A) Modem (B) Gateway (C) Switch (D) Repeater

19. Which switching technique breaks data into smaller packets for
transmission, allowing multiple packets to share the same network (1)
resources.
Q20 and Q21 are Assertion(A) and Reason(R) 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): If numeric data are to be written to a text file, the data needs
to be converted into a string before writing to the file.
Reasoning (R): write() method takes a string as an argument and writes it (1)
to the text file.
21. Assertion (A): A SELECT command in SQL can have both WHERE and
HAVING clauses.
Reasoning (R): WHERE and HAVING clauses are used to check (1)
conditions, therefore, these can be used interchangeably.
Q No Section-B ( 7 x 2=14 Marks) Marks
22. How is a mutable object different from an immutable object in Python?
Identify one mutable object and one immutable object from the following: (2)
(1,2), [1,2], {1:1,2:2}, ‘123’
23. Give two examples of each of the following: (2)
(I) Arithmetic operators (II) Relational operators
If L1=[1,2,3,2,1,2,4,2, . . . ], and L2=[10,20,30, . . .], then
24. (Answer using builtin functions only)
(I)
A) Write a statement to count the occurrences of 4 in L1.
OR (2)
B) Write a statement to sort the elements of list L1 in ascending
order.
(II)
A) Write a statement to insert all the elements of L2 at the end of L1.
OR
B) Write a statement to reverse the elements of list L2.

25. Identify the correct output(s) of the following code. Also write the minimum
and the maximum possible values of the variable b.
import random
a="Wisdom"
b=random.randint(1,6)
(2)
for i in range(0,b,2):
print(a[i],end='#')

(A) W# (B) W#i#

(C) W#s# (D) W#i#s#

The code provided below is intended to swap the first and last elements of
26. a given tuple. However, there are syntax and logical errors in the code.
Rewrite it after removing all errors. Underline all the corrections made.

def swap_first_last(tup)
if len(tup) < 2:
return tup
new_tup = (tup[-1],) + tup[1:-1] + (tup[0])
(2)
return new_tup

result = swap_first_last((1, 2, 3, 4))


print("Swapped tuple: " result)

27. (I)
A) What constraint should be applied on a table column so that duplicate
values are 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. (2)
(II)
A) Mr Atharva is given task to create a database ADMIN. He has to
create a table USERS with following columns:
User_id int
User_name varchar(20)
Password – varchar(10)
Help him complete the two tasks.
OR
(B) Ms Anamika is given task to work on table Student having columns stud_id,
name,class and stream. She has to delete a record named Rahul having
stud)id 100 from table and add another student who took recently
admission with details:
Stud_id 123
Name Rajeev
Class 12
Stream Science
Help her complete the two tasks.

28. A) List one advantage and one disadvantage of star topology.


OR (2)
B) Expand the term SMTP. What is the use of SMTP?

Section-C ( 3 x 3 = 9 Marks)
29. A) Write a Python function that displays all the words containing @gmail
from a text file "Emails.txt".
OR (3)
B) Write a Python function that finds and displays all the words longer than5
characters from a text file "Words.txt".
A dictionary d_city contains the records in the following format: (3)
30
{state: city}
Define the following functions with the given specifications:
i) Push_city(d_city): it takes the dictionary as an argument and pushes all
the cities in the stack CITY whose states are of more than 4 characters.
ii) Pop_city(): this function pops the cities and displays “Stack empty” when
no more cities in the stack.
State the output of the following code: (3)
31
s='India Growing'
n=len(s)
m=''
for i in range(0,n):
if(s[i]>='a' and s[i] <='m'):
m=m+s[i].upper()
elif (s[i] >='o' and s[i] <='z'):
m=m+s[i-1]
elif (s[i].isupper()):
m=m+s[i].lower()
else:
m=m+'@'
print(m)
Q No. Section-D ( 4 x 4 = 16 Marks) Marks

32. Consider the table ORDERS as given below

O_Id C_Name Product Quantity Price


1001 Jitendra Laptop 1 12000
1002 Mustafa Smartphone 2 10000
1003 Dhwani Headphone 1 1500
Note: The table contains many more records than shown here.
A) Write the following queries:
(I) To display the total Quantity for each Product, excludingProducts (4)
with total Quantity less than 5.
(II) To display the orders table sorted by total price in descending
order.
(III) To display the distinct customer names from the Orders table.
(IV) Display the sum of Price of all the orders for which the quantity is
not mentioned.
OR
B) Write the output
(I) Select c_name, sum(quantity) as total_quantity
from orders group by c_name;
(II) Select * from orders where product like
'%phone%';
(III) Select o_id, c_name, product, quantity, price
from orders where price between 1500 and 12000;
(IV) Select max(price) from orders;
You have a stack named BooksStack that contains records of books. Each
33.
book record is represented as a list containing book_title, author_name, and
publication_year.
Write the following user-defined functions in Python to perform the specified
operations on the stack BooksStack:
i) push_book(BooksStack, new_book): This function takes the stack
BooksStack and a new book record new_book as arguments and
pushes the new book record onto the stack.
(1 ½
+
ii) pop_book(BooksStack): This function pops the topmost book record

from the stack and returns it. If the stack is already empty, the
+
function should display "Underflow". 1)
iii)peep(BookStack): This function displays the topmost element of the stack
without deleting it. If the stack is empty, the function should display 'None'.

Consider the table Rent_cab, given below : Table : Rent_cab (4)


34
Based on the given table, write SQL queries for the following :
(i) Display Cab name and Additional Charge (35% of charges) of all cabs
(ii) Increase the charges of all the cabs by 10%.
(iii) Delete all the cabs whose maker name is "Carus".
(iv) Display color wise no of cabs available.

35

(4)

Q No. Section-E ( 2 x 5 = 10 Marks) Marks

36.

(1+4)

37. Logistic Technologies Ltd. is a Delhi based organization which is expanding its
office set-up to Ambala. At Ambala office campus, they are planning to have 3
different blocks for HR, Accounts and Logistics related work. Each block has a
number of computers, which are required to be connected to a network for
communication, data and resource sharing.
As a network consultant, you have to suggest the best network related solutions
for them for issues/problems raised in (i) to (v), keeping in mind the distances
between various block/locations and other given parameters.

Distances between various blocks/locations :


(5)

Number of computers installed at various blocks are as follows :

(i) Suggest the most appropriate block/location to house the SERVER in


the Ambala office. Justify your answer.
(ii) Suggest the best wired medium to efficiently connect various blocks
within the Ambala office compound.
(iii) Draw an ideal cable layout (Block to Block) for connecting these blocks
for wired connectivity.
(iv) The company wants to schedule an online conference between the
managers of Delhi and Ambala offices. Which protocol will be used for
effective voice communication over the Internet ?
(v) Which kind of network will it be between Delhi office and Ambala office ?

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