XII_CS_WC_SET2 QP
XII_CS_WC_SET2 QP
COMMON EXAMINATION
CLASS XII
COMPUTER SCIENCE - 083/ 2
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/ 2
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 TypeError Exception is raised when the data type of an object in an
operation is inappropriate.
2. Given the following dictionary
dic1={‘aman’:85,’pahul’:98,’divya’:75}
print(sorted(dic1))
Select the correct output:
a) [‘aman’, ‘divya’, ‘pahul’] b) {‘aman’, ‘divya’, ‘pahul’}
c) [75,85,98] d) [‘aman’:85,’divya’:75,’pahul’:98]
3. Evaluate the following expression:
bool((not True and int(False)) + (not(False and True)))
4. Wahid 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
5. Read the following python code and write the output.
Str=”World Peace”
print(Str[:6][1:-2])
a) dlro b)orl c)orld d)Wrd P
6. What will happen if newline argument is not defined in an open() function while creating
a csv file?
7. Consider the following code and justify the output if it executes without error, if not specify
the name of the error.
L=[1,2,3]
T=(‘a’,’b’,’c’)
L+=T
print(L)
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. Which of the following function can work with NULL values in a database?
a) avg() b) sum() c) count(*) d) count()
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. Pick one 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
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. VOIP is expanded as ______________________.
3|Page
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): Global variable is declared outside all the functions.
Reasoning (R): It is accessible through out all the functions.
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
23. i) Find the output generated by the following code:
mystr = “hello this is an application to apply and demonstrate split, slicing”
print(mystr.title().split()[5:-2][-1:5])
ii) if L1= [19,23,17,13,71] and L2=[21,5,11,31,55]
a) merge L1 with L2 so that they merge to become a single list in the name L1.
OR
b) Arrange the elements of L1 and L2 in ascending order.
24. Identify the possible outputs of the following program from the given below options: Also
write the minimum and maximum value generated.
import random
color = [‘Black’,’White’,’Yellow’,’Blue’]
for i in range(random.randint(0,2)):
print(color[i], end="*")
print()
a) Black*White* b) Black* c) Black*White*Yellow* d) No output
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 are constraints in SQL? Illustrate with examples.
28. a) What is an URL? Identify the different parts of the URL with an example.
OR
b) Tabulate the differences between circuit switching and packet switching.
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.
30. 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.
5|Page
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 (car names) of the dictionary into a stack, where the corresponding value
(price) is greater than or equal to 900000.
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
31. 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")
6|Page
SECTION – D (4x 4=16)
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 Olympics() in Python to read all the records from the file
“Olympics.csv” which stores the records with the following fields “Country Name”,
“Gold”, “Silver”, ”Bronze” to store the name of the country and the number of gold, silver
and bronze medals. Now, Display the total number of medals obtained by a particular
country when the country name is given as input. [ Assume that the file is already present
in the hard disk].
34. Write the SQL Queries for (i) to (iv) based on the table EMPLOYEE and DEPARTMENT.
Table – EMPLOYEE
EMP_ID NAME DEPT JOIN_DT SALARY
E1 Vanitha 101 2015-01-01 50000
E2 Karthika 102 2015-02-01 75000
E3 Prathiba 103 2014-01-05 85000
E4 Mihika 101 2016-06-10 100000
E5 Mridula 102 2014-10-15 95000
Table –DEPARTMENT
DEPT_ID D_NAME
101 Production
102 Sales
103 Marketing
i) To display department name and number of employees in each department.
ii) To display department name and sum of the salary spent by the department, where
the total amount spent by the department as salary is more than 1,00,000.
7|Page
iii) To display the name of the employee in descending order of their seniority
iv) A) Write a command to modify the DEPT column of EMPLOYEE table, so that the column
can accept values only when such DEPT_ID is available in the DEPARTMENT table.
OR
B) Add a new column called DOB of type date to EMPLOYEE.
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.
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.
MAIN ADMIN
FINANCE
ACADEMIC
VIJAYAWADA
CAMPUS
8|Page
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