0% found this document useful (0 votes)
28 views9 pages

Computer Science - Xii - Question Paperfinal

The document outlines the structure and content of the Computer Science common examination for Class XII for the academic year 2024-25, including instructions, question distribution across sections, and specific programming tasks. It contains 37 compulsory questions divided into five sections, with varying marks assigned to each section. The examination focuses on Python programming, SQL queries, and theoretical concepts in computer science.
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)
28 views9 pages

Computer Science - Xii - Question Paperfinal

The document outlines the structure and content of the Computer Science common examination for Class XII for the academic year 2024-25, including instructions, question distribution across sections, and specific programming tasks. It contains 37 compulsory questions divided into five sections, with varying marks assigned to each section. The examination focuses on Python programming, SQL queries, and theoretical concepts in computer science.
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/ 9

CSSC ZONE 4 (SOUTH CLUSTER)

COMMON EXAMINATION 2024-25


SUB: COMPUTER SCIENCE (083) Reading Time: 15 min
CLASS XII Duration: 3 Hours
Maximum Marks: 70

General Instructions:
● This question paper contains 37 questions.
● All questions are compulsory. However, internal choices have been provided in some questions.
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 of the following is a valid identifier:
1.
i. 9type ii. _type iii. Same-type iv. True (1)

What will be the output of the following code?


2.
A=”Virtual Reality”
print(A.replace(‘Virtual’,’Augmented’))
(1)
i) Virtual Augmented
ii) RealityAugmented
iii) Augmented Virtual
iv) Augmented Reality

Consider two tuples given below:


3.
>>>tup1=(1,2,4,3)
>>>tup2=(1,2,3,4) (1)
What will the following statement print(tup1<tup2)
i. True ii. False iii. Error iv. None of these

What is the output of the program given below:


4.
import random
x = random.random()
y= random.randint(0,4) (1)
print(int(x),”:”, y+int(x))
i. 0: 0 ii . 2 : 4 iii. 1: 6 iv. 0 : 5
5. What will be the output of the following code snippet?
message= "Hello World" (1)
print(message[-2::-2])
6. What will be the output of the following code?
d1={1:2,3:4,5:6}
d2=d1.setdefault(4,8) (1)
print(d2)
a) 3 b) 4 c) 8 d)6
Evaluate the expression given below if A=16 and B=15.
7
A % B // A
a) 1 b) 0.0 c) 0 d) 1.0
(1)

8. Suppose a tuple Tup is declared as Tup = (12, 15, 63, 80),


which of the following is incorrect?
a) print(Tup[1]) (1)
b) Tup[2] = 90
c) print(min(Tup))
d) print(len(Tup))
9. What will be the output of the following code?
my_list = [1, 2, 3, 4, 5]
my_list.extend([6, 7, 8])
(1)
print(my_list)
a) [1, 2, 3, 4, 5, 6, 7, 8]
b) [1, 2, 3, 4, 5, [6, 7, 8]]
c) [1, 2, 3, 4, 5, (6, 7, 8)]
d) [1, 2, 3, 4, 5, {6, 7, 8}]

10. Mention the modes in which the file pointer is at the end of the line. (1)
Look at the following code and select the correct description of error shown while
11. executing it :
X=int(input(“Enter a number”)) (1)
R=X+50
print “Sum = “ ,R
a) can only concatenate str(not “int”) to str
b) Missing parenthesis in call to ‘print’
c) Name ‘Print’ is not defined
d) None of the above

12. What is returned by int(math.pow(3, 2))?


a)6 b) 9 (1)
c) error, third argument required d) error, too many arguments

13. Mr. Soman created a table named “Student” with the fields Rollno, Student_name, (1)
Class and Section. He entered several rows into the table. When he displayed the
entered rows, he found that Rollno’s were duplicated without knowing it.
If you were in Soman’s position, what type of constraints would you apply to avoid
the above data redundancy?
14. The UPDATE SQL clause can
a) Update only one row at a time
b) Update more than one row at a time
c) Delete more than one row at a time (1)
d) Delete only one row at a time
15. Which of the following clause is used to sort records in a table?
a) GROUP
b) GROUP BY
(1)
c) ORDER BY
d) ORDER

16. The operation whose result contains all pairs of tuples from the two relations,
regardless of whether their attribute values match.
a) Join (1)
b) Intersection
c) Union
d) Cartesian Product
17. Out of the following, which is the costliest wired and wireless medium of
transmission?
(1)
Infrared, Coaxial cable, optical fibre microwave, satellite, twisted pair
cable.
18. The IP(Internet protocol) of TCP/IP transmits packets over the internet using ______
a.circuit
b.message
(1)
c.packet
d.all of these
19. VoIP can be used for following communication
(A) Audio (1)
(B) Video
(C) data
(D) All of the above
Q20 and Q21 are Assertion(A) and Reason(R) based questions. Mark the
correct choice as:
Both A and R are true and R is the correct explanation for A
Both A and R are true and R is not the correct explanation for A
A is True but R is False
A is False but R is True
20. Assertion (A): PRIMARY KEY constraint is given with the column. (1)
Reason (R): NULL values are not allowed to be entered using the NOT NULL
constraint
21. Assertion (A): CSV file is a human readable text file where each line has a number
of fields,separated by commas or some other delimiter.
Reason (R): writerow() function can be used for writing into writer object. (1)

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

22. Raman has written a code to find its sum of digits of a given number passed as
parameter tofunction sumdigits(n). His code has errors. Rewrite the correct code and
underline the corrections made. (2)
def sumdigits(n):
d=0
for x in
str(n):
d=d+x
return d
n=int(input(‘Enter any number”))
s=sumdigits(n)
print(“Sum of digits”,s)

23. If L1 = [5, 3, 5, 2, 8, 5, 9, 1, ...] and L2 = [15, 25, 35, ...], then:


(i)a) Write a statement to count the occurrences of 5 in L1. (2)
OR
b) Write a statement to sort the elements of list L1 in descending order.
(ii)a) Write a statement to extend L1 by adding all the elements of L2 at
the end.
OR
b) Write a statement to reverse the order of elements in L2.
24. Given two tables,
Student (Rollno, Admno, name, Class) and Fees (FeeID,Rollno,amount)
Develop an SQL query to combine two tables with the help of foreign key.
(OR)
(2)
Ruby is working in a database named CLIENT, in which she created a table named
“ORDER” containing columns Order_ID, Order_name, Amount, DOD. After
creating
the table she notice that the customer name is not mentioned. So she decided to add a
new column “C_Name” of string datatype. She also decided that the category DOD
is
not required and decided to delete. Help her to write the commands to complete the
task.
25. What is the difference between global and Local variables with respect to user
defined functions in python? Illustrate with an example. (2)

26. Write two points of difference between Switch and Router.


(OR) (2)
Write two points of difference between Web Server and Web Browser.

27. (A)Given is a Python string declaration:


message='FirstPreBoardExam@2022-23'
Write the output of: print(message[ : : -3].upper())
(B) Write the output of the code given below:
d1={'rno':25, 'name':'dipanshu'}
d2={'name':'himanshu', 'age':30,'dept':'mechanical'}
d2.update(d1) (2)
print(d2.keys())

28. What are the possible output(s) of the following code?Also specify the maximum
and minimum values that can be assigned to variable x.
import random (2)
M=[“Car”,”Tar”,”Roar”,”Boar”]
X=random.randint(0,3)
for I in range(x+1):
print(M[i],” “,end=” “)
a. Car Tar
b. Tar Roar
c. Car Tar Roar Boar
d. Roar Boar

Section-C ( 3 x 3 = 9 Marks) Marks


Q No.

29. Write a method SHOWLINES() in Python to read lines from text file
‘TESTFILE.TXT’ and display the lines which do not contain 'ke'.
(3)
Example: If the file content is as follows:
An apple a day keeps the doctor away.
We all pray for everyone’s safety.
A marked difference will come in our country.
The SHOWLINES() function should display the output as:
We all pray for everyone’s safety.
Or
Write a function RainCount() in Python, which should read the content of
a text file “RAIN.TXT” and then count and display the count of occurrence of
word RAIN (case-insensitive) in the file.
Example: If the file content is as follows:
It rained yesterday
It might rain today
I wish it rains tomorrow too
I love Rain
The RainCount() function should display the output as: Rain – 2
30. Write the following user-defined functions in Python to perform the specified
operations on the stack PlayersStack:
(I) push_player(PlayersStack, new_player):
This function takes the stack PlayersStack and a new player record
new_player as arguments and pushes the new player record onto the stack.
(II) pop_player(PlayersStack):
This function pops the topmost player record from the stack and returns it. (3)
If the stack is already empty, the function should display "Underflow".
(III) peep_player(PlayersStack):
This function displays the topmost element of the stack without deleting it.
If the stack is empty, the function should display 'None'.
Or
Write a Python program to input an integer and display all its even factors in
ascending order, using a stack.
For example, if the input number is 360, the output should be:
2 4 6 8 10 12 18 20 24 30 36 40 60 72 90 120 180 360
Hint: The even factors of a number are the factors that are divisible by 2.
31. Predict the output of the following code:
fruits = ["apple", "banana", "cherry"]
counts = [3, 2, 4]
output_str = "" (3)
for i in range(len(fruits)):
for j in range(counts[i]):
output_str += fruits[i][0] + "*"
output_str += "\n"
print(output_str)
or
Predict the output of the following code
numbers = [5, 8, 3, 6]
for i in numbers:
for j in range(i % 4):
print(j + 1, '*', end="")
print()

Section-D ( 4 x 4 = 16 Marks) Marks


Q No.
32. Write output of the queries (i) to (iv) based on the table Sportsclub
Table Name: Sportsclub
playerid pname sports country rating salary
10001 PELE SOCCER BRAZIL A 50000
10002 FEDERER TENNIS SWEDEN A 20000
10003 VIRAT CRICKET INDIA A 15000
(4)
10004 SANIA TENNIS INDIA B 5000
10005 NEERAJ ATHLETICS INDIA A 12000
10006 BOLT ATHLETICS JAMAICA A 8000
10007 PAUL SNOOKER USA B 10000
(i) SELECT DISTINCT sports FROM Sportsclub;
(ii) SELECT sports, MAX(salary) FROM Sportsclub GROUP BY sports
HAVING sports<>'SNOOKER';
(iii) SELECT pname, sports, salary FROM Sportsclub WHERE
country='INDIA' ORDER BY salary DESC;
(iv) a) SELECT SUM(salary) FROM Sportsclub WHERE rating='B';
Or
b) SELECT pname, sports, country FROM Sportsclub WHERE
rating='A'
AND salary > 10000;
33. (i) Write a program to insert data into a CSV file called employee_data.csv. The
program should include two functions:
insert_data(): Accept employee information as input from the user
(Employee ID, EmpName, Department, and Monthly Salary) and insert this
data into the CSV file (employee_data.csv)
display_data(): Read the employee_data.csv file and display the data in a
tabular format.
(ii) Raju is a python programmer working in a leading software company in (2+ 2)
Chennai. He is assigned with a task to provide the employee name for their annual
appreciation with incentive. For this he created a csv file named “incentive.csv” to
store the names of the employee in different criteria. The structure of the file is:
[Emp_id, Emp_Name, Emp_Designtion,No of Incentives received]
He needs to write a user defined functions that performs the following tasks
Accept() – to accept the details from the user and add it to the file.
Incentive() – to display the name of employee who received incentive more
than 3 times.
The file “incentive.csv” should have a proper title.
34.
Saman has been entrusted with the management of Law University Database. He
needs to access some information from FACULTY and COURSES tables for a
survey analysis. Help him extract the following information by writing the desired
SQL queries as mentioned below.
Table: FACULTY
F_ID FName LName Hire_Date Salary
102 Amit Mishra 12-10-1998 12000
103 Nitin Vyas 24-12-1994 8000 (4)
104 Rakshit Soni 18-5-2001 14000
105 Rashmi Malhotra 11-9-2004 11000
106 Sulekha Srivastava 5-6-2006 10000

Table:COURSES
C_ID F_ID CName Fees
C21 102 Grid Computing 40000
C22 106 System Design 16000
C23 104 Computer Security 8000
C24 106 ,Human Biology 15000
C25 102 Computer Network 20000
C26 105 Visual Basic 6000
i) To display complete details (from both the tables) of those Faculties
whose salary is less than 12000.
ii) To display the details of courses whose fees is in the range of 20000
to 50000 both values included).
iii)To increase the fees of all courses by 500 which have "Computer" in
their Course names.
iv) (A) To display names (FName and LName) of faculty taking System
Design.
OR
(B) To display the Cartesian Product of these two tables.
35. Consider a table named STUDENT in a database, which has the following structure:
Field Type
name varchar(50)
marks int(3)
Write a Python program to perform the following operation:
 Update the marks of the student named 'pop' from 90 to 99.
 After updating the marks, the program should print the number of
records affected by the update operation. (4)
Assume the following database connection details:
Host: localhost
User: root
Password: password
Database: STUDENTDB
SECTION E (2 X 5 = 10 Marks) Marks
Q.No
36. i. Differentiate the method read() and readlines().
ii. Keshav is a student in CBSE school. He is assigned with a project to work on
binary file operations. Help him to accomplish the below task.
o addrecord() to create a binary file called “Student.DAT” containing
information of the student in form of list datatype.
Information to be collected Rollno, name, marks(out of 100) of each (2+3=5)
student.
o search() to display the name and marks based on the Rollno.
(OR)
i. How text files are different from binary files.
ii. Mr. Mathew is a programmer who has recently joined the company and
given
a task to write a python code to perform update operations in binary
file(Emp.dat) which contains (EmpID, Ename and Salary). Help him to
perform the below task.
• Addvalue() to create a binary file called “Emp.dat”and inserts the above
value as user input.
• Updatvalue() – update the salary of the employee by 2000 Rs whose emp
no is 23.
37. Granuda consultants are setting up a secured network for their office campus at
Faridabad for their day to day office and web based activities. They are planning to
have connectivity between 3 buildings and the head office situated in Kolkata.
Answer the Question (a) to (e) after going through the bulding poditions in the
campus and the other details which are given below:
Distance between the buildings:
• Building Ravi to Jamuna → 120 m
• Building Ravi to Ganga → 50 m
• Building Ganga to Jamuna → 65 m
• Faridabad campus to Head Office → 1460 km
Number of Computers:
• Building Ravi → 25 Nos.
• Building Jamuna → 150 Nos.
• Building Ganga → 51 Nos.
• Head Office → 10 Nos.
a) Suggest the most suitable place to house the server of this organization.
Also
give a reason to justify your suggested location.
b) Suggest a cable layout of connections between the buildings inside the (5)
campus.
c) Suggest the placement of the following devices with justification:
• Switch • Repeater
d) The organization is planning to provide a high speed link with its head
office situated in KOLKATA using a wired connection. Which of the
following device will be most suitable for this job?
i. Optical Fiber
ii. Co-axial cable
iii. Ethernet cable
e) The organization is planning to connect its Head office with Faridabad
campus. Which type of network out of LAN, MAN, or WAN will be
formed? Justify your answer.
(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) A) What would be your recommendation for enabling live visual
communication between the Admin Office at the Mumbai campus and
the DELHI Head Office from the following options:
a) Video Conferencing
b) Email
c) Telephony
d) Instant Messaging
OR
B) What type of network (PAN, LAN, MAN, or WAN) will be set up
among the computers connected in the MUMBAI campus?

You might also like