XII_CS_WC_SET1 QP
XII_CS_WC_SET1 QP
COMMON EXAMINATION
CLASS XII
COMPUTER SCIENCE - 083/ 1
BLUE PRINT
1|Page
WEST CHENNAI SAHODAYA CLUSTER
(General Instructions )
Please check this question paper contains 8 printed pages
Please check this question paper contains 37 questions.
Please write down the serial number of the question before attempting it.
Reading time of 15 minutes is given to read the question paper alone. No writing during this time.
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.
COMMON EXAMINATION
CLASS XII
COMPUTER SCIENCE - 083/ 1
Roll No. __________ MAX. MARKS: 70
Date: 18-12-2024 DURATION: 3 HRS
SECTION – A ( 21 x 1=21)
1. State True or False:
In Python, a ValueError is raised when a function receives an argument of the right
type but an inappropriate value.
2. Identify the correct output of the following code snippet from the options given.
S="ELEVATE YOURSELF"
S=S.replace('EL','@')
print(S)
a) @EVATE YOURS@F c) @LEVATE YOURS@LF
b) @VATE YOURS@F d) @LEVATE YOURS@F
3. Evaluate the following expression:
bool((not True and int(False)) + (not(False and True)))
4. Wahim want to execute the following code and get the desired output as: “R*o*g*e*r”
But his code is incomplete. Help him to complete the code by filling the missing line, so
that the above output could be printed.
a=”Roger”
print(______________)
2|Page
6. csv.reader() is used to read the file, which returns an ____________
7. Consider the following code snippet and identify the value that could be stored in L after
execution of the code.
L= [ [10]*3 ]
L.insert( 3, 4)
a) [ [10],[10],[10],4] b) [ [10,10,10],4]
c) [ 10,10,10,4] d) [ [10,4], [10,4], [10,4] ]
8. What is the use of id() function in python?
a) returns the data type of object b) returns the size of the object
c) returns the identity of object d) None of the above
9. Pick one of the following statements to correctly complete the function body in the given
code snippet.
def f(number):
# Missing function body
print(f(5))
a) return "number" b) print(number)
c) print("number") d) return number
10. A file “Sample.txt” exists with total length as 100 bytes. Write the missing statement in the
following code:
F=open(“Sample.txt”)
M=____________ # to read first 50 bytes from the file, or if the line ends before 50 bytes
# should read the first line of the file
print(M)
11. Which of the following function can work with NULL values in a database?
a) avg() b) sum() c) count(*) d) count()
12. Which of the following commands will change row(s) of the table from MySQL database?
a) REPLACE TABLE b) CHANGE TABLE
c) UPDATE d) ALTER TABLE
13. What will the following statement prints?
print(max(“sector.145.com”.split(‘.’)))
14. State True or False:
The del statement in tuple will work with slicing
15. Which of the following statements is false?
a. A try-except block can have more than one except statement
b. One block of except statement cannot handle multiple exceptions
c. The finally block is always executed
d. When 1 == "1" is executed, exception is raised
16. ______________protocol has 3 layers of protection.
a) SMTP b) FTP c) HTTP d) HTTPS
17. The add clause in SQL is used to
a) add a column b) add a condition
c) add a record d) All of the above.
18. Identify the cable which consists of an inner copper core and a second conducting outer
sheath:
a) Twisted Pair b) Co-axial c) Fiber Optical d) Shielded Twisted Pair
19. A Local telephone line network is an example of_____________ switching technique.
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
3|Page
(C) A is True but R is False
(D) A is False but R is True
20. Assertion (A): For changes made to a variable defined within a function to be visible
outside the function, it should be declared as global.
Reasoning (R): Variables defined within a function are local to that function by default,
unless explicitly specified with the global keyword.
21. Assertion (A): The Delete command of SQL deletes the rows of the table.
Reasoning (R): The command deletes all the rows and also the table structure from the
memory.
SECTION– B (7 x 2 = 14)
22. i) Write a python statement to print the sum of least and most significant digit of a 4-digit
number assigned to a variable B. For example, if B is 2345
then output should be 2+5 =7
ii)Write python statement for the following:
a) to find the number of occurrences of alphabet ‘c’ in a string S
OR
b) to find the position of letter ‘c’ in S
25. i) Ravi a python programmer is working on a project, for some requirement, he has to
define a function with name CalculateInterest(), he defined it as:
def CalculateInterest(Principal, Rate=.06,Time):
# code
But this code is not working, can you help Ravi to identify the error in the above function
and what is the solution?
ii) Consider the following code:
def check():
global num
num=1000
print(num)
num=100
print(num)
check()
print(num)
How does the statement “global num” influences the program, Explain?
4|Page
26. An organization SoftSolutions is maintaining their employee’s records using SQL table.
Table: HRDATA
Ecode EName Desig Remn
80001 Lokesh Programmer 50000
80004 Aradhana Manager 65000
80007 Jeevan Programmer 45000
80008 Arjun Admin 55000
80012 Priya Executive 35000
i) a) Identify the candidate keys and primary key of the above table.
OR
b) What constraint can be applied to EName so that no NULL values are permitted.
ii) a) Add a column REMARKS in the table with datatype as varchar and size as 100
characters
OR
b) Delete the column Remn from HRDATA.
27. What is the use of modify clause in an Alter Command? Explain with example.
28. a) Write two advantages of Bus topology over Star topology.
OR
b) A small tech startup is expanding its office network infrastructure. The team is
considering whether to use Optical Fiber Cables or Coaxial Cables for their high-speed
internet and communication requirements. The startup needs a solution that ensures fast
data transmission, supports long distances, and is resilient to external interference.
Based on the case study, Suggest the transmission medium (wired and wireless) suitable
for the startup to use with justification.
SECTION – C (3 x 3 = 9)
29. A) Write a Python function DISPLAY() that displays the longest palindromic word from a
text file “Article.txt”.
For Example if the file contains;
“Malayalam is one of the Indian language.
Arjun is driving a racecar.
Have some civic sense.
The highest level of cognitive domain is evaluation.”
Then the output should be Malayalam.
OR
B) A file “Phone.txt” is a text file contains Zone Name and Phone Number in the following
format.
NORTH 7577843767
SOUTH 9865576321
EAST 7865432564
WEST 7435248988
Write a function DISPLAY() in python to open the file in an appropriate mode to retrieve zone
names and phone number. Display the zone name with the phone numbers whose phone
number starts with the number ‘7’. Assume that the file already exists in the System.
5|Page
30. A) Predict the output of the following program:
def change(s):
d = {"UPPER" : 0, "LOWER" : 0 }
for c in s:
if c.isupper():
d["UPPER"] += 1
elif c.islower():
d["LOWER"] += 1
else:
pass
print("Upper case count :", d["UPPER"])
print("Lower case count :", d["LOWER"])
change("School Days are Happy")
OR
B) Predict the output of the following program:
def makenew(m):
news=""
count=0
for i in m:
if count%2==0:
news=news+i.lower()
else:
if i.islower():
news=news+i.upper()
else:
news="-".join(news+i)
count+=1
news=news+m[:3]
print("The new string is:",news)
makenew("STRING76")
31. A) A list contains the following record of a Hostel: [Hostel_No, Total_Students, TotalRooms].
Write the following user defined functions to perform given operations on the stack
named ‘Hostel’:
(i) Push_element() - To push an object containing Hostel_No and Total Students along with
Total Rooms to the stack
(ii) Pop_element() - To pop the objects from the stack and display them. Also, display
“Stack Empty” when there are no elements in the stack.
For example:
If the lists of Hostel details are:
[ [1,2000,1000], [2, 1500,800], [3,5000,2000] ]
The output should be:
[3,5000,2000]
[2, 1500,800]
[1,2000,1000]
Stack Empty
OR
B) Pranay has created a dictionary containing 5 different car names and their prices as key –
value pairs.
Write separate user defined functions to perform the following operations:
Push the keys and values(car name, price) of the dictionary into a stack, where the
corresponding value (price) is greater than or equal to 900000.
6|Page
Pop and display the content of the stack ad make the stack to be empty at the end.
For example:
If the sample content of the dictionary is as follows:
MyDict={“Maruthi”:750000, ”Hyundai”:850000,”Kia”: 900000,
”Honda”:1050000,”Ford”:1080000}
The output of the program should be : Ford 1080000
Honda 1050000
Kia 900000
32. Consider the table Employee and answer the questions under the options A or B given
below:
Table: Employee
EID NAME DOB DOJ SALARY PROJECT
E01 Ranjan 1990-07-12 2015-01-21 150000 P01
E02 Akhtar 1992-06-21 2015-02-01 125000 P04
E03 Muneera 1996-11-15 2018-08-19 135000 P01
E04 Alex 1991-10-25 2017-10-19 75000 P02
E05 Satyansh 1993-12-16 2018-10-19 85000 NULL
Note: The table contains many more records than shown here.
A) Write SQL Queries for the following questions:
i) Display the total salary of all employees who had assigned a project.
ii) Display the number of employees assigned for each project.
iii) Display the project details without repetition.
iv) Display the employee name who born after October 1992.
OR
B) Write the output of the queries (i) to (iv) based on the table Employee:
i) select NAME, PROJECT from Employee order by PROJECT;
ii) select NAME, SALARY from Employee where DOJ like '2015%';
iii) select NAME, DOB, DOJ from Employee where SALARY between 100000 and
200000;
iv) select min(DOJ), max(DOB) from employee;
33. Write a function def Television() in Python to read all the records from the file
“Inventroy.csv” which stores the records of various products such as Television,
Refrigerator, Air-Conditioner etc., under different fields as mentioned below:
Code Item Company Price Quantity
T/01 Television LG 42000 15
T/02 Television Sony 45000 20
F/01 Refrigerator LG 55000 25
…….. ………… ……. ……… ……
…….. ………… ……. ……… ……..
Now, Display the details of all televisions of various companies from the file, also display
the total cost of all televisions. [Assume that the file is already present in the hard disk]
7|Page
34. Write the SQL commands for the questions (i) to (iv) based on the relations
MOBILEMASTER & MOBILESTOCK given below:
Table: MOBILEMASTER
Table: MOBILESTOCK
i) Display the total Quantity of mobiles and mobile name available for every mobile.
ii) Display the name of the Suppliers supplying the mobile of the company “Nokia”
iii) Decrease the price of the mobile by 2000 whose manufacturer date is between 2011 and
2013.
iv ) A) Display the total cost of the “Micromax” company mobiles. (total cost is price *quantity)
OR
B) Add a new column called discount of type integer to the MOBILEMASTER.
35. Kathir wants to write a program in Python to do the following in the table named
Student in MYSQL database SCHOOL:
rno(Roll number ) integer
name(Name) string
DOB (Date of birth) Date
Fee float
Note the following to establish connectivity between Python and MySQL:
Username - root
Password - tiger
Host - localhost
i) The values of fields rno, name, DOB and Fee has to be accepted from the user and
appended to the table Student.
ii) To increase the Fee of the all the students by 10%
Help Kathir to complete the program in Python.
SECTION – E ( 2 x 5 =10)
36. Vedansh is a teacher working in a school. For the Annual Sports Event, he wants to create a
binary file, ‘Result.dat’ with the following specification:
Student_Id integer
Student_Name string
Game_Name string
Points integer
Result string (Won/Loss)
to store the results of students in different sports events. You, as a programmer, have been
assigned to do this job for Vedansh.
8|Page
i) Write a function to input the data of the students and append it in the binary file.
ii) Write a function to Display the records of those students who won the game, which is
inserted in the Result field with ‘Won’ and ‘Loss’ data.
iii) Write a function to Update the Result of the students from Loss to Won if the points is
greater than 50.
37. ELITE University of Andhra Pradesh is setting up a secured network for its campus at
VIJAYAWADA for operating their day-to-day office & web based activities. They are
planning to have network connectivity between four buildings MAIN, ADMIN, FINANCE,
ACADEMIC.
Answer the question (a) to (e) after going through the building positions in the campus & other
details which are given below:
The distances between various buildings of university are given as
Building 1 Building 2 Distance in meters
Main Admin 50
Main Finance 120
Main Academic 70
Admin Finance 50
Finance Academic 70
Admin Academic 60
Number of computers in each building
Building No. of Computers
Main 150
Admin 75
Finance 50
Academic 60
a) Suggest cable layout for the connections between the various buildings.
b) Suggest the most suitable building to house the server of the network of the university.
c) Suggest the placement of following devices with justification:
i) Switch/Hub ii) Repeater
d) Which device is needed if internet connection is to be provided to all the blocks and
also suggest where it is to be placed?
e) i) What type of network will be set up among the computers connected in the ELITE
campus ?
OR
ii) Which wired communication medium is most recommended for connecting the
computers in the building?
***************END OF PAPER***************
9|Page