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

Guwahati CS-23

Uploaded by

gojo2875473989
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)
85 views7 pages

Guwahati CS-23

Uploaded by

gojo2875473989
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 SANGTHAN, GUWAHATI REGION

CLASS XII COMPUTER SCIENCE (083)


PREBOARD – I ( 2023-24)
TIME: 03 HOURS M.M.: 70
General Instructions:
• Please check this question paper contains 35 questions.
• The paper is divided into 4 Sections- A, B, C, D and E.
• Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.
• Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
• Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
• Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
• Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
• All programming questions are to be answered using Python Language only
SNO QUESTION MARKS
SECTION A
State True or False
1 1
"In Python, data type of a variable depends on its value"
Fill in the blank:
2 ___________ command is used to add a new column in a table in SQL. 1
a) update b) remove c) alter d)drop
Predict the correct output of the following Python statement –
3 print(4 + 3**3/2) 1
(a) 8 (b) 9 (c) 8.0 (d) 17.5
Consider the string state = “Guwahati”. Identify the appropriate statement that will display
4 the last five characters of the string state? 1
(a) state [-5:] (b) state [4:] (c) state [:4] (d) state [:-4]
Consider the Python statement: f.seek(10, 1)
Choose the correct statement from the following:
(a) file pointer will move 10 byte in forward direction from beginning of the file
5 1
(b) file pointer will move 10 byte in forward direction from end of the file
(c) file pointer will move 10 byte in forward direction from current location
(d) file pointer will move 10 byte in backward direction from current location
Which of the following function returns a list datatype?
6 a) d=f.read() b) d=f.read(10) c) d=f.readline() d) d=f.readlines() 1

A table has initially 5 columns and 8 rows. Consider the following sequence of operations
performed on the table –
i. 8 rows are added ii. 2 columns are added
7 1
iii. 3 rows are deleted iv. 1 column is added
What will be the cardinality and degree of the table at the end of above operations?
(a) 13,8 (b) 8, 13 (c) 14,5 (d) 5,8
Select the correct output of the code:
s = "Question paper 2023-24"
s= s.split('2')
8 1
print(s)
(a) ['Question paper ', '0', '', '-', '3'] (b) ('Question paper ', '0', '', '-', '3')
(c) ['Question paper ', '0', '3-', '4'] (d) ('Question paper ', '0', '2', '', '-', '3')
Identify the output of the following python code:
D={1:”one”,2:”two”, 3:”three”}
9 L=[] 1
for k,v in D.items():
if ‘o’ in v:

Page - 1
L.append(k)
print(L)
(a) [1,2] (b) [1,3] (c)[2,3] (d)[3,1]
A relation can have only one______key and one or more than one______keys:
10 (a) PRIMARY, CANDIDATE (b) CANDIDATE, ALTERNATE 1
(c) CANDIDATE ,PRIMARY (d) ALTERNATE, CANDIDATE
Find the output of the given Python program?
>>>t = (1)
11 >>>type(t) 1
a) <class ‘int’> b) <class ‘float’>
c) <class ‘list’> d) <class ‘tuple’>
_____ is a standard mail protocol used to receive emails from a remote server to a local email
12 client. 1
(a) SMTP (b) POP (c) HTTP (d) FTP
How many except statements can a try-except block have?
13 A. 0 B. 1 1
C. more than one D. more than zero
Consider the code given below:

14 1

Which of the following statements should be given in the blank for #Missing Statement, if
the output produced is 110?
a. global a b. global b=100
c. global b d. global a=100
Which switching technique reserve the entire bandwidth in advance.
15 a. Message Switching b. Packet Switching 1
c. Circuit Switching d. None
Fill in the blank:
For each attribute of a relation, there is a set of permitted values,
16 called the _______of that attribute. 1
(a) cardinality (b) degree (c) domain (d) tuple
Q17 and 18 are ASSERTION AND REASONING 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

Assertion (A):- The default arguments can be skipped in the function call.
17 Reasoning (R):- The function argument will take the default values even if the values are 1
supplied in the function call
Assertion (A):- If a text file already containing some text is opened in write mode the previous
contents are overwritten.
18 1
Reasoning (R):- When a file is opened in write mode the file pointer is
present at the beginning position of the file
Page - 2
SECTION B
Mithilesh has written a code to input a number and evaluate its factorial and then finally
print the result in the format : “The factorial of the <number> is <factorial value>” His code is
having errors. Rewrite the correct code and underline the corrections made.
f=0
num = input("Enter a number whose factorial you want to evaluate :")
19 n = num 2
while num > 1:
f = f * num
num -= 1
else:
print("The factorial of : ", n , "is" , f)
a. Write one points of difference between Bus topology and star topology.
20 2
b. Write one points of difference between XML and HTML.
Write the output of the code given below:
data = [2,4,2,1,2,1,3,3,4,4]
d = {}
for x in data:
21 if x in d: 2
d[x]=d[x]+1
else:
d[x]=1
print(d)
Predict the output based on the list, cod = [98, 45, 62, 14, 1007]
a) print(cod * 2)
b) print(cod[:2]+cod[2:])
c) print(cod. pop(1))
22 d) print(cod.pop()) 2
OR
A list named studentAge stores age of students of a class. Write the Python command to
import the required module and (using built-in function) to display the maximum age value
from the given list.
(a) Given is a Python List declaration:
lst1= [39, 45, 23, 15, 25, 60].
What will be the output of :
print(lst1.index(23))
23 (b) Write the output of the code given below: 2
x = [“rahul”, 5, “B”, 20, 30]
x.insert(1,3)
x.insert( 3, “akon”)
print(x[2])
24 Write two points of difference between ALTER and UPDATE command in SQL. 2

Page - 3
Write the output of the following code:
def change(m, n=10):
global x
x+=m
n+=x
25 2
m=n+x
print(m,n,x)
x=20
change(10)
change(20)
SECTION – C
A pre-existing text file data.txt has some words written in it. Write a python function
displaywords() that will print all the words that are having length greater than 3.
Example:
For the fie content:
A man always wants to strive higher in his life
He wants to be perfect.
26 3
The output after executing displayword() will be:
Always wants strive higher life wants perfect
OR
A pre-existing text file info.txt has some text written in it. Write a python function
countvowel() that reads the contents of the file and counts the occurrence of
vowels(A,E,I,O,U) in the file.
Write the output of the queries (a) to (d) based on the table

27 3

(a) SELECT min(Population) FROM country;


(b) SELECT max(SurfaceArea) FROM country Where Lifeexpectancy <50;
(c) SELECT Count(Distinct Continent) FROM country;
Write a function in Python PUSH(Num), where Num is a list of numbers. From this list push all
numbers divisible by 5 into a stack implemented by using a list. Display the stack if it has
atleast one element, otherwise display appropriate error message.
For example:
If the list Num is:
[66, 75, 40, 32, 10, 54]
28 The stack should contain: 3
[75, 40, 10]
OR
Write functions in Python, MakePush(Package) and MakePop(Package) to add a new
Package and delete a Package from a List of Package Description, considering them to act as
push and pop operations of the Stack data structure.

Page - 4
Predict the output of the Python code given below:
myvalue = ["A", 40, "B", 60, "C", 20]
alpha = 0
beta = ""
gama = 0
29 for i in range(1,6,2): 3
alpha += i
beta += myvalue[i-1]+ "#"
gama += myvalue[i]
print(alpha, beta, gama)
Write the SQL queries for the following:
Emp table data
EMPNO ENAME JOB MGR HIREDATE SAL COMM
7369 SMITH CLERK 7902 17-Dec-80 800
7499 ALLEN SALESMAN 7698 20-Feb-81 1600 300
7521 WARD SALESMAN 7698 22-Feb-81 1250 500
7566 JONES MANAGER 7839 02-Apr-81 2975
30 7654 MARTIN SALESMAN 7698 28-Sep-81 1250 1400 3
7698 BLAKE MANAGER 7839 01-May-81 2850
7782 CLARK MANAGER 7839 09-Jun-81 2450

a. List the emp names starting with ‘M’ with 5 chars.


b. Increase the salary by 5% of personals whose commission is known.
c. Delete the record of personals who have salary greater than 2500.
SECTION D
Write a Program in Python that defines and calls the following user defined functions:
(i) ADD() – To accept and add data of an employee to a CSV file ‘record.csv’. Each record
31 consists of a list with field elements as empid, name and mobile to store employee id, 4
employee name and employee salary respectively.
(ii) COUNTR()- To count the number of records present in csv file record.csv
Based on the given set of tables write answers to the following questions.
Table: flights
flightid model company
10 747 Boeing
12 320 Airbus
15 767 Boeing

Table: Booking
ticketno passenger source destination quantity price Flightid
10001 ARUN BAN DEL 2 7000 10
32 10002 ORAM BAN KOL 3 7500 12 4
10003 SUMITA DEL MUM 1 6000 15
10004 ALI MUM KOL 2 5600 12
10005 GAGAN MUM DEL 4 5000 10
a) Write a query to display the passenger, source, model and price for all bookings
whose destination is KOL.
b) Display structure of table Booking.
c) Display ticketno, passenger, source ,destination in the descending order of price.
d) Identify the column acting as foreign key and the table name where it is present in
the given example.

Page - 5
SECTION E
National Centre for Indigenous Arts has just set up a new Campus and they want to set up a
Local area network.
The distances between various buildings of university are given as:-
Main to Admin 50 mtr
Main to Finance 100 mtr
Main to Academic 70 mtr
Admin to Finance 50 mtr
Finance to Academic70 mtr
Admin to Academic 60 mtr
Number of computers in each building:-
Main Building 150
Admin Building 75
33 Finance Building 50 5
Academic Building 60
As a network expert, you are required to give best possible solutions for the given queries of
the university administration:-
(a) Suggest and draw cable layout to efficiently connect various buildings/blocks.
(b) Suggest the most suitable building to house the server of this university with a suitable
reason.
(c) Which network device will be used to connect computers in each block to form a local
area network?
(d) Suggest the transmission medium out of the following for setting-up very fast Internet
connectivity among buildings of the university :
1. Optical Fiber 2. Coaxial cable 3. Ethernet Cable
e) Is there a requirement of a repeater in the given cable layout? Why/ Why not?
a) Differentiate between r+ and w+ file modes in Python.
b) Consider a file, STUDENT.DAT, containing records of the following structure:
[RNO, Name, class, sec]
Write a function, copyData(), that reads contents from the file STUDENT.DAT and copies the
records with class as ‘XII’ to the file named XII.DAT. The function should return the total
number of records copied to the file XII.DAT.
OR
(i) How are text files different from binary files?
34 1+4
(ii) A Binary file,VEHICLE.DAT has the following structure:
{VNO:[VNAME, VTYPE]} Where :
VNO –Vehicle Number
VNAME – Vehicle Name
VTYPE is Vehicle Type (Petrol/Diesel)
Write a user defined function, findType(mtype), that accepts mtype as parameter and
displays all the records from the binary file VEHICLE.DAT, that have the value of Vehicle Type
as mtype.
a) Give one difference between primary key and unique key.
b) Sartaj has created a table named Book in MYSQL database Library:
• bno(Book number )- integer
• bname(Book Name) - string
• DOP (Date of purchase) – Date
35 1+4
• Price – float
Note the following to establish connectivity between Python and MySQL:
• Username - root
• Password - tiger
• Host - localhost
Page - 6
Sartaj, now wants to display the records of books whose price is more than 500. Help Sartaj
to write the program in Python.
OR
a. What is Cross join? Explain with example.
b. Kabir wants to write a program in Python to insert the following record in the table named
Book in MYSQL database,Library:
• bno(Book number )- integer
• bname(Book Name) - string
• DOP (Date of purchase) – Date
• Price – float
Note the following to establish connectivity between Python and MySQL:
• Username - root
• Password - tiger
• Host - localhost
The values of fields: bno, bname, DOP and price has to be accepted from the user. Help Kabir
to write the program in Python.

Page - 7

You might also like