0% found this document useful (0 votes)
96 views7 pages

full_portion_qp

Uploaded by

buffybenita
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)
96 views7 pages

full_portion_qp

Uploaded by

buffybenita
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

KENDRIYA VIDYALAYA SANGATHAN, CHENNAI REGION

29/12/2024 CLASS:COMPUTER
XII SESSION: 2024-25 SCIENCE - 083
PREBOARD
COMPUTER SCIENCE (083)
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 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


1 State True or False 1
In Python, a dictionary is an ordered collection of items(key:value pairs).
2 State the output of the following 1
L1=[1,2,3] i) [1,3,7]
L2=L1
ii) [2,3,7]
L1.append(7)
L2.insert(2,14) iii) [1,14,3,7]
L1.remove(1) iv) [2,14,3,7]
print(L1)
3 The following expression will evaluate to 1
print(2+(3%5)**1**2/5+2)
i) 5 ii) 4.6 iii) 5.8 iv) 4

4 What is the output of the expression? 1


food=’Chinese Continental’
print(food.split(‘C’))
i) ('', 'hinese ', 'ontinental')
ii) ['', 'hinese ', 'ontinental']
iii) ('hinese ', 'ontinental')
iv) ['hinese ', 'ontinental']
5 What will be output of the following code snippet? 1
Msg=’Wings of Fire!’
print (Msg[-9: :2])
6 What will be the output of the following: 1
T1=(10)
print(T1*10)
i) 10 ii) 100 iii)(10,10) iv(10,)
7 If farm is a t as defined below, then which of the following will cause an exception? 1
farm={‘goat’:5,’sheep’:35,’hen’:10,’pig’:7}
i) print(str(farm))
ii) print(farm[‘sheep’,’hen’])
iii) print(farm.get(‘goat))
iv) farm[‘pig’]=17
8 What does the replace(‘e’,’h’) method of string does? 1
i) Replaces the first occurrence of ‘e’ to ‘h’
ii) Replaces the first occurrence of ‘h’ to ‘e’
iii) Replace all occurrences of ‘e’ to ‘h’
iv) Replaces all occurrences of ‘h’ to ‘e’
9 If a table has 1 primary key and 3 candidate key, how many alternate keys will be in 1
the table.
i) 4 ii) 3 iii)2 iv)1
10 Write the missing statement to complete the following code 1
file = open("story.txt")
t1 = file.read(10)
_________________________#Move the file pointer to the beginning of the file
t2= file.read(50)
print(t1+t2)
file.close()
11 Which of the following keyword is used to pass the control to the except block in 1
Exceptional handling?
i) pass ii) finally iii) raise iv)throw
12 What will be the output of the following code: 1
sal = 5000
def inc_sal(per):
global sal i) 5000%6000$
inc = sal * (per / 100) ii) 5500.0%6000$
sal += inc iii) 5000.0$6000%
inc_sal(10) iv) 5500%5500$
print(sal,end='%')
sal=6000
print(sal,end='$')

13 State the sql command used to add a column to an existing table? 1


14 What will be the output of the following query? 1
Mysql> SELECT * FROM CUSTOMER WHERE CODE LIKE ‘_A%’
A) Customer details whose code’s middle letter is A
B) Customers name whose code’s middle letter is A
C) Customers details whose code’s second letter is A
D) Customers name whose code’s second letter is A
15 Sushma created a table named Person with name as char(20) and address as 1
varchar(40). She inserted a record with “Adithya Varman” and address as “Vaanam
Illam, Anna Nagar IV Street”. State how much bytes would have been saved for this
record.
i)(20,34) ii)(30,40) iii)(14,40) iv)14,34)
16 _____ gives the number of values present in an attribute of a relation. 1
a)count(distinct col) b)sum(col) c)count(col) d)sum(distinct col)
17 The protocol used identify the corresponding url from ip address is _____ 1
a)IP b)HTTP c)TCP d)FTP
18 The device used to convert analog signal to digital signal and vice versa is .. 1
a)Amplifier b)Router c)Modem d)Switch
19 In ___________ switching technique, data is divided into chunks of packets and 1
travels through different paths and finally reach the destination.
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) : A function can have multiple return statements 1
Reason (R) : Only one return gets executed Values are returned as a tuple.
21 Assertion (A) : DROP is a DDL command 1
Reason(R ) : It is used to remove all the content of a database object

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


22 Differentiate list and tuple with respect to mutability. Give suitable example to 2
illustrate the same .
23 Give two examples of each of the following 2
a) Assignment operators b) Logical operators
24 If L1 = [13,25,41,25,63,25,18,78] and L2= [58,56,25,74,56] 2
(i) A) Write a statement to remove fourth element from L1
Or
B) Write the statement to find maximum element in L2

(ii) (A) write a statement to insert L2 as the last element of L1


OR
(B) Write a statement to insert 15 as second element in L2
25 Identify the correct output(s) of the following code. Also write the minimum and the 2
maximum possible values of the variable Lot

import random
word='Inspiration'
Lot=2*random.randint(2,4)
for i in range(Lot,len(word),3):
print(word[i],end='$')

i) i$a$i$n$ ii) i$n$


iii) i$t$n$ iv) a$i$n$

26 Identify Primary Key and Candidate Key present if any in the below table name 2
Colleges. Justify
Streng
Cid Name Location Year AffiUniv PhoneNumber
th
University
St. Xavier's
1 Mumbai 1869 10000 of 022-12345678
College
Mumbai
Loyola University
2 Chennai 1925 5000 044-87654321
College of Madras
Hansraj Delhi
3 New Delhi 1948 4000 011-23456789
College University
Christ Christ
4 Bengaluru 1969 8000 080-98765432
University University
Lady Shri
Delhi
5 Ram New Delhi 1956 2500 011-34567890
University
College
27 (I) 2
(A) What constraint/s should be applied to the column in a table to make it as
alternate key?
OR
(B) What constraint should be applied on a column of a table so that it becomes
compulsory to insert the value
(II)
(A) Write an SQL command to assign F_id as primary key in the table named flight
OR
(B)Write an SQL command to remove the column remarks from the table name
customer.
28 List one advantage and disadvantage of star and bus topology 2
OR
Define DNS and state the use of Internet Protocol.

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


29 (A) Write a function that counts no of words beginning with a capital letter from 3
the text file RatanJi.txt
Example:
If you want to Walk Fast,
Walk Alone.
But - if u want to Walk Far,
Walk Together
Output:
No of words starting with capital letter : 10

OR
(B) Write a function that displays the line number along with no of words in it
from the file Quotes.txt
Example :
None can destroy iron, but its own rust can!
Likewise, none can destroy a person, but their own mindset can
The only way to win is not be afraid of losing.
Output:
Line Number No of words
Line 1: 9
Line 2: 11
Line 3: 11
30 (A) There is a stack named Uniform that contains records of uniforms Each record 3
is represented as a list containing uid, uame, ucolour, usize, uprice.
Write the following user-defined functions in python to perform the specified
operations on the stack Uniform :
(I) Push_Uniform(new_uniform):adds the new uniform record onto the stack
(II) Pop_Uniform(): pops the topmost record from the stack and returns it. If
the stack is already empty, the function should display “underflow”.
(III) Peep(): This function diplay the topmost element of the stack without
deleting it.if the stack is empty,the function should display ‘None’.
OR
(a) Write the definition of a user defined function push_words(N) which accept
list of words as parameter and pushes words starting with A into the stack
named InspireA
(b) Write the function pop_words(N) to pop topmost word from the stack and
return it. if the stack is empty, the function should display “Empty”.

31 Predict the output of the Python code given below: 3


Con1="SILENCE-HOPE-SUCCEss@25"
Con2=""
i=0
while i<len(Con1):
if Con1[i]>='0' and Con1[i]<='9':
Num=int(Con1[i])
Num-=1
Con2=Con2+str(Num)
elif Con1[i]>='A' and Con1[i]<='Z':
Con2=Con2+Con1[i+1]
else:
Con2=Con2+'^'
i+=1
print(Con2)

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


No. ks
32 Consider the following table named Vehicle and state the query or state the output 4
Table:- Vehicle
VID LicensePlate VType Owner Contact State
Cost
1 MH12AB1234 Car Raj Kumar 65 9876543210 Maharastra
2 DL3CDE5678 Truck Arjith Singh 125 8765432109 New Delhi
3 KA04FG9012 Motor cycle Prem Sharma 9123456789 Karnataka
4 TN07GH3456 SUV Shyad Usman 65 9987654321 Tamil Nadu
5 KA01AB1234 Car Devid jhon 65 9876543210 Karnataka
6 TN02CD5678 Truck Anjali Iyer 125 8765432109 Tamil Nadu
7 AP03EF9012 Motor cycle Priya Reddy 9123456789 Andhra Pradesh
(A)
(i) To display number of different vehicle type from the table vehicle
(ii) To display number of records entered vehicle type wise whose minimum cost is above 80
(iii)To set the cost as 45 for those vehicles whose cost is not mentioned
(iv) To remove all motor cycle from vehicle
OR
(B)
(i) SELECT VTYPE,AVG(COST) FROM VEHICLE GROUP BY VTYPE;
(ii) SELECT OWNER ,VTYPE,CONTACT FROM VEHICLE WHERE OWNER LIKE
“P%”;
(iii)SELECT COUNT(*) FROM VEHICLE WHERE COST IS NULL;
(iv) SELECT MAX(COST) FROM VEHICLE;
33 A CSV file “Movie.csv” contains data of movie details. Each record of the file contains the 4
following data:
1.Movie id
2.Movie name
3.Genere
4.Language
5.Released date
For example, a sample record of the file may be:
["tt0050083",’ ‘12 Angry Men is’,’Thriller’.’Hindi’,’12/04/1957’]
Write the following functions to perform the specified operations on this file
(i) Read all the data from the file in the form of the list and display all those records for
which language is in Hindi.
(ii) Count the number of records in the file.
34 Salman has been entrusted with the management of Airlines Database. He needs to access some 4
information from Airports and Flights tables for a survey. Help him extract the following
information by writing the desired SQL queries as mentioned below.
Table - Airports
A_ID A_Name City IATACode
1 Indira Gandhi Intl Delhi DEL
2 Chhatrapati Shivaji Intl Mumbai BOM
3 Rajiv Gandhi Intl Hyderabad HYD
4 Kempegowda Intl Bengaluru BLR
5 Chennai Intl Chennai MAA
6 Netaji Subhas Chandra Bose Intl Kolkata CCU
Table - Flights
F_ID A_ID F_No Departure Arrival
1 1 6E 1234 DEL BOM
2 2 AI 5678 BOM DEL
3 3 SG 9101 BLR MAA
4 4 UK 1122 DEL CCU
5 1 AI 101 DEL BOM
6 2 6E 204 BOM HYD
7 1 AI 303 HYD DEL
8 3 SG 404 BLR MAA
i) To display airport name, city, flight id, flight number corresponding flights whose
departure is from delhi
ii) Display the flight details of those flights whose arrival is BOM, MAA or CCU
iii) To delete all flights whose flight number starts with 6E.
iv) (A) To display Cartesian Product of two tables
OR
(B) To display airport name,city and corresponding flight number
35 A table named Event in VRMALL database has the following structure: 4

Field Type
EventID int(9)
EventName varchar(25)
EventDate date
Description varchar(30)
Write the following Python function to perform the specified operations:
Input_Disp(): to input details of an event from the user and store into the table Event. The
function should then display all the records organised in the year 2024.

Assume the following values for Python Database Connectivity


Host-localhost, user-root, password-tiger

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


36 Ms Joshika is the Lab Attendant of the school. She is asked to maintain the project 5
details of the project synopsis submitted by students for upcoming Board Exams.
The information required are:
-prj_id - integer
-prj_name-string
-members-integer
-duration-integer (no of months)
As a programmer of the school u have been asked to do this job for Joshika and define
the following functions.
i) Prj_input() - to input data of a project of student and append to the binary
file named Projects
ii) Prj_update() - to update the project details whose member are more than 3
duration as 3 months.
iii) Prj_solo() - to read the data from the binary file and display the data of all
project synopsis whose member is one.
37 P&O Nedllyod Container Line Limited has its headquarters at London and regional 5
office at Mumbai. At Mumbai office campus they planned to have four blocks for HR,
Accts, Logistics and Admin related work. Each block has number of computers
connected to a network for communication, data and resource sharing
As a network consultant, you have to suggest best network related solutions for the
issues/problems raised in (i) to (v), keeping in mind the given parameters

REGIONAL OFFICE MUMBAI

HR ADMIN
London Head
Head Head
Office
Accts Logistics

Distances between various blocks/locations:


Admin to HR 500m
Accts to Admin 100m
Accts to HR 300m
Logistics to Admin 200m
HR to logistics 450m
Accts to logistics 600m
Number of computers installed at various blocks are as follows:
Block No of computers
ADMIN 95
HR 70
Accts 45
Logistics 28
i) Suggest the most appropriate block to place the sever in Mumbai office.
Justify your answer.
ii) State the best wired medium to efficiently connect various blocks within
the Mumbai Office.
iii) Draw the ideal cable layout (block to block) for connecting these blocks
for wired connectivity.
iv) The company wants to conduct an online meeting with heads of regional
office and headquarter. Which protocol will be used for the effective voice
communication?
v) Suggest the best place to house the following
a) Repeater b) Switch

You might also like