[go: up one dir, main page]

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

XIIComp SC S E 476

This document outlines the question paper for Class XII Computer Science at SRI Vijay Vidyashram Senior Secondary School, covering various topics in Python programming, SQL, and networking. It consists of five sections with a total of 70 marks, including multiple-choice questions, short answers, and programming tasks. Students are instructed to answer all questions using Python language only.

Uploaded by

adamshameem3712
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)
17 views9 pages

XIIComp SC S E 476

This document outlines the question paper for Class XII Computer Science at SRI Vijay Vidyashram Senior Secondary School, covering various topics in Python programming, SQL, and networking. It consists of five sections with a total of 70 marks, including multiple-choice questions, short answers, and programming tasks. Students are instructed to answer all questions using Python language only.

Uploaded by

adamshameem3712
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

SRI VIJAY VIDYASHRAM SENIOR SECONDARY SCHOOL BAGLUR

CS Board Scheme (Level1)


COMPUTER SCIENCE
CLASS: XII
Time Allowed: 3 hr Maximum Score:70

General Instructions:

 This question paper contains five sections, Section A to E.


 All questions are compulsory.
 Section A has 21 questions carrying 01 mark each.
 Section B has 07 Very Short Answer type questions carrying 02 marks each
 Section C has 03 Short Answer type questions carrying 03 marks each.
 Section D has 04 Long Answer type questions carrying 04 marks each.
 Section E has 02 questions carrying 05 marks each.
 All programming questions are to be answered using Python Language only.

Section A

1. What will be the output of the following code snippet?


print(2**3 + (5 + 6)**(1 + 1))
a. 129 b. 8 c. 121 d. None of the above.
2. Which among the following is a valid identifier?
a. False b. none c. for d. none of these
3. How can you concatenate two strings in Python?

a) Using the concat() method b) Using the join() method

c) Using the & operator d) Using the + operator

4. What is the output of the following Python code snippet?


string = "Hello, World!"
print(string[3:7])

a) “Hello” b) “lo,” c) “lo, W” d) “lo, World”

5. What is the output of the following Python code snippet?


A=”Hello World”
print(A.find(‘m’))

6. Which of the following methods is used to add an element to the end of a list in
Python?

a) append() b) add() c) insert() d) extend()

7. What is the output of the following Python code snippet?


my_list=[1,2,3,4,5]

print(my_list[2:4])

8. What will be the output of the following Python code snippet?


my_dict={‘a’:1,’b’:2,’c’:3}

result=my_dict.get(‘b’,0)

print(result)

a) 1 b) 2 c) 3 d) 0

9. Which of the following statements about function arguments in Python is true?

a) All arguments must have default values

b) Functions cannot have more than one argument

c) Arguments are passed by value

d) Arguments can have default values

10. What function is used to read the entire contents of a file as a string in Python?

a) read_file() b) reads() c) readlines() d) read()

11. What does the tell() method do in Python file handling?

a) Returns the current line number being read

b) Returns the current position of the file cursor

c) Tells if the file exists or not

d) Tells the file size


12. What is the purpose of the ‘a+’ mode when opening a file in Python?

a) It opens the file in append mode for reading and writing

b) It opens the file in append mode for writing only

c) It opens the file in append mode for reading only

d) It opens the file in append mode for reading, writing, and creating

13. What is the purpose of the try block in Python error handling?

a) To define the block of code where an exception may occur

b) To catch and handle exceptions that occur within the block

c) To ensure that the code executes without any errors

d) To terminate the program if an exception occurs


14. What is the use of Bridge in the Network?

a) To connect LANs b) To separate LANs

c) To control network speed d) All of the above

15. What is a Firewall in computer network?

a) The physical boundary of network

b) An operating system of computer network

c) A system designed to prevent unauthorized access

d) A web browsing software

16. Bluetooth is an example of

a) Wide area network b) Virtual private network

c) Local area network d) Personal area network

17. Which command is used to remove a table from a database in SQL?

a) DELETE b) DROP c) REMOVE d) TRUNCATE

18. Which of the following is used to modify the structure of a database?

a) DDL (Data Definition Language) b) DML (Data Manipulation Language)

c) TCL (Transaction Control Language) d) DCL (Data Control Language)

19. What is a data dictionary?

a) A tool to store user data

b) A collection of all the data in a database

c) A repository that stores metadata about the database

d) A special database table

20. Assertion (A) : Python standard library consist of number of modules.

Reason® : A function is a module is used to simplify the code and avoids repetition.

21. Assertion(A) :A database is centrally stored data and a DBMS is a system to manage
the database.
Reason® :DBMS is a database management system, which is a software managing
the databases.

Section B
22. List out any two differences between list and dictionary?

23. Consider the dictionaries :

D1={‘One’:’A’,’Two’:’B’,’Three’:’C’} and D2={‘Four’:’D’,’Five’:’E’,’One’:’Z’}

(Answer using built in functions only)

a. Display the value of the key ‘Two’ from dictionary D1.

b. Insert the dictionary D2 in D1.

24. Give an example for Assignment operators and Logical operators?

25. What will be the output of the following code

import random

List=[‘apple’,’orange’,’kiwi’,’grapes’]

for i in range(4):

x=random.randint(1,3)

print(List[x],end=’#’)

a. apple#orange#kiwi#grapes# c. orange#kiwi#grapes#orange#

b. orange#orange#orange#apple# d. orange#orange#kiwi#orange#

26. The code provided below is intended tofind the sum of te didits of a number. However,
there are syntax and logical errors in the code. Rewrite it after removing all errors.
Underline all the corrections made.

def sum_digits(x):
sum=1
while x>=0:
sum+=x%10
x=x/10
print(“the sum of the digit of a number is:”sum)
n=input(“enter the number”)
sum_digits(n)
27. A. Which constraints ensure that that all values in a column are different
B. Which constraints is a combination of a NOT NULL and UNIQUE
C. Write an sql command to add a columns gender with data type char(5) into the table
employee
D. Write an sql command to delete the details of employee whose name ends with ‘i’

28. A. List one advantage and one disadvantage of star topology.

B. What is pop3 protocol?

Section C
29. Write a python function display_words() that display all the words that contain a
substring ‘is’ from the file data.txt

30. You have a stack named Car that contains records of cars. Each book record is
represented as a list containing car_name,company_name,model and price. Write the
following user-defined functions in Python to perform the specified operations on the
stack Car:

(I) push_car(): This function pushes the car_name and model of the cars ,which
company is Hundai or Suzuki into stack Car.

(II) pop_book(): This function pops the topmost car record from the stack and returns
it. If the stack is already empty, the function should display "Underflow".

(III) peep(BookStack): This function displays the topmost element of the stack without
deleting it. If the stack is empty, the function should display 'None'

31. Predict the output of the following:

A. l=[30,24,56,78,75,80,93]
for i in l:
if i%10==0:
x+=i//5
elif i%5==0:
y+=i*2
else:
z+=i*3
print(x,y,z)
OR
B. my_dict={}
my_dict[(1,2,4)]=8
my_dict[(4,2,1)]=10
my_dict[(1,2)]=12
sum=0
for k in my_dict:
sum+=my_dict[k]
print(sum)
print(my_dict)
Section D
32. Consider the table Items as given below and write down the .

Item_id Item_name Company quantity Price_per_item

101 TV LG 12 18000

102 Mixy Whirlpool 14 5700

103 AC Samsung 15 28000

104 TV Samsung 18 19500

105 Refrigerator LG 29 18000

106 Refrigerator Whirlpool 10 17500

a. Display the details of item which price within range of 15000 and 20000

b. Display the number of item of each company

c. Display the details of item in the ascending order of thie price

d. Delete the details of item which price ic grater than 25000

33. Write SQL queries for (a) to (g) and write the output for the SQL queries mentioned
shown in (hi) to (h4) parts on the basis of table ITEMS and TRADERS :

a. To display the number of items, which are traded by each trader. The expected
output of this query should be:
b. To display the price, item name and quantity (i.e., qty) of those items which have
quantity more than 150.
c. To display the names of those traders, who are either from DELHI or from
MUMBAI.
d. To display the names of the companies and the names of the items in descending
order of company names.

OR

Obtain the outputs of the following SQL queries based on the data given in tables ITEMS
and TRADERS above.

a. SELECT MAX (PRICE), MIN (PRICE) FROM ITEMS;


b. SELECT PRICE*QTY FROM ITEMS WHERE CODE-1004;
c. SELECT DISTINCT TCODE FROM ITEMS;
d. SELECT INAME, TNAME FROM ITEMS I, TRADERS T WHERE I.TCODE=T.TCODE
AND QTY< 100;

34. A csv file Train.csv has the following structure [t_no,t_name,source,destination,kilometer]


Write the following Python functions to perform the specified operations on this file:
a. Add_train() :- add the details of the train into the csv file
b. Read_train(): Read all the data from the file in the form of a list and display all
those records for which the run more than 1000 kilometer
c. Copy_train(): Copy all the details of train start from delhi from Train .csv file and
store into Delhi.csv
35. A table, named Shop, in Store database, has the following structure:
Field Type
Shope_id int
Item_name Varchar(20)
price int
quantity int

Write the following Python function to perform the specified operation:


a. Create_Shope() :- Create the table Shop into the database Stroe
b. AddAndDisplay(): To input details of an item and store it in the table Shop. The
function should then retrieve and display all records from the Shop table where the
Price is greater than 120.

Assume the following for Python-Database connectivity:

Host: localhost, User: root, Password: tiger

Section E
36. Jagan is an managing director of Royal Pickle company. He needs to manage the records
of various pickles. For this, he wants the following information of each type of pickle to
be stored:
 Pickle_id -int
 Pickle_type -varchar(20)
 Pickle_Quantity -int
 Price -int
 No_of_stock -int
You, as a programmer of the company, have been assigned to do this job for Jagan.
a) Write a function to input the data of a candidate and append it in a binary file.

b) Write a function to update the data of candidates whose experience is more than 10
years and change their designation to "Senior Manager".

c) Write a function to read the data from the binary file and display the data of all those
candidates who are not "Senior Manager".
37. Galaxy Provider Ltd. is planning to connect its office in Texas, USA with its branch at
Mumbai. The Mumbai branch has 3 Offices in three blocks located at some distance
from each other for different operations-ADMIN, SALES and ACCOUNTS. As a network
consultant, you have to suggest the best network related solutions for the
issues/problems raised in (a) to (d), keeping in mind the distances between various
locations and other given parameters.

Layout of the Offices in the Mumbai branch:

No of computers install at
Distance between various location
various location

ADMIN to SALES 300m


ADMIN Block 255

SALES to ACCOUNTS 175m


ACCOUNTS Block 75

ADMIN to ACCOUNTS 350m SALES Block 30

MUMBAI Branch to TEXAS Head 140000 TEXAS Head Office 30


Office km

a. It is observed that there is a huge data loss during the process of data transfer from

one block to another. Suggest the most appropriate networking device out of the

following, which needs to be placed along the path of the wire connecting one block

office with another to refresh the signal and forward it ahead.


b. Which hardware networking device out of the following, will you suggest to connect all

the computers within each block?

c. Which service/protocol out of the following will be most helpful to conduct live

interactions of employees from Mumbai Branch and their counterparts in Texas?

d. Draw the cable layout (block to block) to efficiently connect the three offices of the

Mumbai branch.

You might also like