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

Computer Sc XII 2024-25(set 1)

This document is a Computer Science question paper for Class XII for the session 2024-25, consisting of 37 compulsory questions divided into five sections. Each section varies in the number of questions and marks, with programming questions specifically requiring Python. The paper covers a range of topics including Python programming, SQL, and data structures.
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)
7 views

Computer Sc XII 2024-25(set 1)

This document is a Computer Science question paper for Class XII for the session 2024-25, consisting of 37 compulsory questions divided into five sections. Each section varies in the number of questions and marks, with programming questions specifically requiring Python. The paper covers a range of topics including Python programming, SQL, and data structures.
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

No of Pages - 7

CLASS: XII SESSION: 2024-25


COMPUTER SCIENCE (Set -1 )

Time allowed: 3 Hours Maximum Marks: 70

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


Which operator is used for replication?
1. a) + b) % c) * d) // (1)
If the following code is executed, what will be the output of the following code?
2. name="Computer_Science_with_Python" (1)
print(name[-25:10])
3. Which of the following expressions evaluates to False?
a) not(True) and False b) True or False c) not(False and True) d)True and not(False)
(1)
What will be the output of the following code?
4. print(“100+200”) (1)
a) 300 b) 100200 c) 100+200 d) 200

Find the output of the following: (1)


5. >>>Name = “Python Examination”
>>>print (Name [ : 8 : -1])

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


tuple1 = (1, 2, 3)
tuple2 = tuple1
tuple1 += (4,)
(1)
print(tuple1 == tuple2)
a) True b) False c) tuple1 d) Error
Consider the following dictionary „D‟. Display all the items of the dictionary as
7. individual tuple
D = {„A‟: 20, „B‟: 30, „C‟:40. „D‟: 50} (1)

PTO

1
What will be the output after the following statements?
8. a = [0, 1, 2, 3]
del a[:] (1)
print(a)
a) None b)[ ] c) [0, 1, 2, 3] d) NameError

9. If a table which has one Primary key and two alternate keys. How many
(1)
Candidate keys will this table have?
a) 1 b) 2 c) 3 d) 4

10. The contents of a text file named „quote.txt‟ is as shown below:


All the kings horses and all the kings men
cannot fix what isn‟t broken
What will be the output of the following code? (1)
fin = open(quote.txt‟)
data = fin.read(10)
print(data[0:3], end= „‟)
data = fin.readline(5)
print(data[0:3] , end= „‟)
fin.seek(0)
data = fin.read(4)
print(data[0:3] , end= „‟)
a) AllngsAll b) AllcanAll c) Allcancan d) Allngscan

Richa is working with a program where she gave some values to the function. She doesn‟t
11. know the term to relate these values. Help her by selecting the correct option.
a) function value b) arguments or parameters c) return values d) function call (1)

Choose the correct answer


12. def fun1(num): (1)
return num+5
print(fun1(5))
print(num)
a) Print value 10 b) Print value 5 c) Name Error d) 25

13. In which datatype the value stored is padded with spaces to fit the specified length. (1)
a) DATE b) VARCHAR c) FLOAT d)CHAR
14. Which SQL command can change the degree of an existing relation? (1)
Which keyword is used to select rows containing column that match a wildcard
15. pattern? (1)
All aggregate functions except ___________ ignore null values in their input
16. collection. (1)
a) Count (attribute) b) Count (*) c) Avg () d) Sum ()

Your friend Sunita complaints that somebody has created a fake profile on Twitter
17. and defaming her character with abusive comments and pictures. Identify the type (1)
of cybercrime for these situations.
Name the network device that connects dissimilar networks. (1)
18.
It allow a visited website to store its own information about a user on the user‟s
19. computer: (1)
a) Spam b).cookies c) Malware d) Adware

2
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 explanationfor A
(C) A is True but R is False
(D) A is False but R is True
Assertion (A):- If the arguments in a function call statement match the number and order of
20. arguments as defined in the function definition, such arguments are called positional
arguments. (1)
Reasoning (R):- During a function call, the argument list first contains default argument(s)
followed by positional argument(s).
Assertion(A) : The USE statement selects a database to make it the default (current)
21. database for a given connection to the server.
(1)
Reason(R): If you want to create tables for a database first you have to select the database.

Q No Section-B ( 7 x 2=14 Marks) Marks


Differentiate between a positional and default arguments with the help of an example. (2)
22.
What is the value of the expression
23. 4+4.00, 2**4.0 (2)
Give the output of the following code:
24. L = [ 1,2,3,4,5,6,7]
B=L
B[3:5] = 90,34
print(L) (2)

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

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


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

The code has written a python function to compute the reverse of a number. Rewrite the
26. code after removing errors also underline the corrections made. (2)
define reverse(num):
rev = 0
While num > 0:
rem == num %10
rev = rev*10 + rem
num = num//10
return rev
print(reverse(1234))

27. (I) A SQL table ITEMS contains the following columns :


INO, INAME, QUANTITY, PRICE,DISCOUNT (1)
Write the SQL command to remove the column DISCOUNT from the table.
OR
Write the SQL statement to display the structure of the table.

3 PTO
(II) What is the syntax for adding a primary key constraint to a table in MySQL?
OR (1)
What is the syntax for droping a primary key constraint to a table in MySQL?
Differentiate between Bps & bps.
28.
OR
Differentiate between SMTP & POP3. (2)

Q No. Section-C ( 3 x 3 = 9 Marks) Marks


Write a Python function that read text file “story.txt” and display all the line
29. having 'a' as last character.
OR
(3)
Write a Python function that finds and displays all the words „a‟ as a last character
from a text file "Words.txt".
30. Coach Abhishek stores the races and participants in a dictionary. Write a program,
with separate user defined functions to perform the following operations:
i) Push the names of the participants of the dictionary onto a stack, where the distance is
more than 100.
ii)Pop and display the content of the stack.
For example: If the sample content of the dictionary is as follows:
Races ={100:'Varnika', 200 :'Jugal', 400:'Kushal', 800:'Minisha'}}
The output from the program should be: Minisha Kushal Jugal

OR
Julie has created a dictionary containing names and marks as key value pairs of N
students. Write a program, with separate user defined functions to perform the
following operations: (3)
● Push the keys (name of the student) of the dictionary into a stack, where the
corresponding value (marks) is greater than 75.
● Pop and display the content of the stack.
For example: If the sample content of the dictionary is as follows:
R={"OM":76, "JAI":45, "BOB":89, "ALI":65, "ANU":90, "TOM":82}
The output from the program should be: TOM ANU BOB OM
31. Predict the output of the following code:
p,q=8, [8]
def sum(r,s=5):
p=r+s
q=[r,s]
print(p, q, sep='@')
sum(3,4)
print(p, q, sep='@')
OR
Predict the output of the following code: (3)
a =30
def call (x):
global a
if a%2==0:
x+=a
else:
x–=a
return x
x=20
print(call(35),end="#")
print(call(40),end= "@")

4
Q No. Section-D ( 4 x 4 = 16 Marks) Marks

32. Consider the table WORKER as given below


TABLE: WORKER
W_ID F_NAME L_NAME CITY STATE
102 SAHIL KHAN KANPUR UTTAR PRADESH
104 SAMEER PARIKH ROOP NAGAR PUNJAB
105 MARY JONES DELHI DELHI
106 MAHIR SHARMA SONIPAT HARYANA
107 ATHARVA BHARDWAJ DELHI DELHI (4)
108 VEDA SHARMA KANPUR UTTAR PRADESH
Note: The table contains many more records than shown here.

Write the following queries:


(I) To display the total record of each city.
(II) To display the worker table sorted by F_NAME in descending order.
(III) To display the distinct state from the table.
(IV) Display the details of all workers where state ends with „DESH‟.

Write a Program in Python that defines and calls the following user defined functions:
33. (i) add() – To accept and add data of an employee to a CSV file „employee.csv‟. Each
record consists of a list with field elements as eid, name and salary to store
employee id, employee name and employee salary respectively. (4)
(ii) search()- To display the records of the employee whose salary is more than 40000.
Study the following tables FLIGHTS and FARES and write SQL commands for the
34. Questions (i) to (iii) and give outputs for SQL query (iv)

TABLE : FLIGHTS
R_NO STARTING ENDING NO_seats NO_STOPS
301 MUMBAI DELHI 8 0
799 BANGALORE DELHI 2 1
101 INDORE MUMBAI 3 0
302 DELHI MUMBAI 8 0
812 KANPUR BANGALORE 3 1 (4)
899 MUMBAI KOCHI 1 4
501 DELHI TRIVANDRUM 1 5
499 MUMBAI MADRAS 3 3
701 DELHI AHMEDABAD 4 0

TABLE : FARES
RL_NO FARE TAX
701 650 10
499 940 5
501 1340 8
899 830 4
302 430 10
799 1050 10
101 350 4

(i) Display R_NO and NO_SEATS,Tax from “KANPUR” to “BANGALORE”.


(ii) Display starting and ending destinations where fare is greater than 1000.
(iii) Increase the Fare of all the flights having RL_NO > 500 by 20 percent.
(iv) SELECT F.R_NO, F.NO_SEATS, R.FARE FROM FLIGHTS F, FARES R
WHERE F.STARTING = „DELHI‟ AND F.R_NO = R.RL_NO;

PTO
5
The code given below deletes the record from the table employee which contains the
35. following record structure:

E_code- String
E_name- String
Sal – Integer
City- String
Note the following to establish connectivity between Python and MySQL :
· Username is root (4)
· Password is root
· The table exists in a MySQL database named emp.
· The details (E_code,E_name,Sal,City) are the attributes of the table.
Write the following statements to complete the code :
Statement 1 – to import the desired library.
Statement 2 – to execute the command that deletes the record with E_codeas 'E101'.
Statement 3 – to delete the record permanently from the database.

import as mysql # Statement 1


def delete() :
mydb=mysql.connect(host="localhost",user="root",passwd="root",database="emp")
mycursor=mydb.cursor()
# Statement 2
# Statement 3
print ("Record deleted")
Q.No. SECTION E (2 X 5 = 10 Marks) Marks
Write a Program in Python that defines and calls the following user defined
36. functions:
(i) ADD() – To accept and add data of an item to a binary file „events.dat‟. Each
record of the file is a list [Event_id, Description, Venue, Guests, Cost].
Event_Id, Description, and venue are of str type, Guests and Cost are of
int type.
(ii) COUNTR() – To read the data from the file events.dat, calculate and (5)
display the average number of guests and average cost.

37. Event Horizon Enterprises is an event planning organization. It is planning to set up 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 (5)
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.

6
Block to Block distances (in Mtrs.) From
To Distance
ADMIN FOOD 42 m
ADMIN MEDIA 96 m
ADMIN DECORATORS 48 m
FOOD MEDIA 58 m
FOOD DECORATORS 46 m
MEDIA DECORATORS 42 m
Distance of Delhi Head Office from Mumbai Campus = 1500 km
Number of computers in each of the blocks/Center is as follows:
ADMIN 30
FOOD 18
MEDIA 25
DECORATORS 20
DELHI HEAD OFFICE 18
(I) Suggest the most appropriate location of the server inside the MUMBAI
campus. Justify your choice.
(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 campusand the DELHI Head Office
from the following options:
a) Video Conferencing
b) Email
c) Telephony
d) Instant Messaging
OR
What type of network (PAN, LAN, MAN, or WAN) will be set up among the
computers connected in the MUMBAI campus?

__________________________________________XX_________________________________________________

You might also like