0% found this document useful (0 votes)
83 views11 pages

G12CS-QP - PB2

The document provides instructions for a Computer Science preboard exam for Class XII. It contains 5 sections (A-E) with a total of 35 multiple choice, very short answer, short answer, and long answer questions. Section A has 18 multiple choice questions worth 1 mark each. Section B has 7 very short answer questions worth 2 marks each. Section C has 5 short answer questions worth 3 marks each. Section D has 3 long answer questions worth 5 marks each. Section E has 2 questions worth 4 marks each. All programming questions must be answered in Python.

Uploaded by

shabazdxb8
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)
83 views11 pages

G12CS-QP - PB2

The document provides instructions for a Computer Science preboard exam for Class XII. It contains 5 sections (A-E) with a total of 35 multiple choice, very short answer, short answer, and long answer questions. Section A has 18 multiple choice questions worth 1 mark each. Section B has 7 very short answer questions worth 2 marks each. Section C has 5 short answer questions worth 3 marks each. Section D has 3 long answer questions worth 5 marks each. Section E has 2 questions worth 4 marks each. All programming questions must be answered in Python.

Uploaded by

shabazdxb8
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/ 11

ROLL NO:

CREDENCE HIGH SCHOOL, DUBAI


PREBOARD- 2
CLASS XII
Computer Science (083)

Maximum Marks: 70 Time Allowed: 3 hours


General Instructions:

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


2. All questions are compulsory.
3. Write options with answers for MCQ questions- Section A
4. Section A have 18 questions (Q1-Q18) carrying 01 mark each. (18marks)
5. Section B has 07 Very Short Answer type questions (Q19-Q25) carrying 02 marks
each. (14marks)
6. Section C has 05 Short Answer type questions (Q26-Q30) carrying 03 marks each.
(15marks)
7. Section D has 03 Long Answer type questions (Q31-Q33) carrying 05 marks each.
(15marks)
8. Section E has 02 questions (Q34-Q35) carrying 04 marks each.(8marks)
9. All programming questions are to be answered using Python Language only.

SECTION A
(Q1-Q18) 18X1=18Marks
1. Which of the following are valid operator in Python? 1
a) */
b) is
c) ^
d) Like

2. Find the invalid identifiers from the following 1


a) def
b) For
c) _bonus
d) 2_Name

3. Find the output - 1


>>>A = [17, 24, 15, 30]
>>>A.insert( 2, 33)
>>>print ( A [-4])

4. Consider an object obj1 = (10, 15, 25, 30). Identify the statement that will result in an error. 1
a) print(obj1[3])
b) obj[2] = obj1[1]*10
c)print(min(obj1))
d) print(len(obj1))

P a g e 1 | 11
5. Which of the following is a Python tuple? 1
a) {2,’00’,’000’}
b) [2,00,000]
c) {2: ‘00’,3:‘000’]
d) 2,00,000
6. Find and write the output of the following python code: 1
def myfunc(a):
a=a+2
a=a*2
return a
print(myfunc(2))
7. Name the argument type that can be skipped from a function call.------------------- 1
8. Select the correct output of the following code - fp.seek(5, 1) 1
a) Move file pointer five characters ahead from the current position.
b) Move file pointer five characters ahead from the beginning of a file.
c) Move file pointer five characters behind from the current position.
d) Move file pointer five characters behind ahead from the end of a file.

9. Select true statement when a file is opened using the with statement 1
a) The with statement makes exception handling complex
b) The file is automatically closed after leaving the block, and all the resources that are
tied up with the file are released.
c) File reading and writing are faster using the with statement.
d) None of these

10. Which of the following function takes 2 arguments? 1


a) load()
b) dump()
c) Both a and b
d) None of the above

11. In specific, if systems use separate protocols, which one of the following devices is used to link 1
two systems?
a) Repeater
b) Gateway
c) Bridge
d) Hub

12. Which of these is not an example of unguided media? 1


a) Optical Fiber Cable
b) Radio wave
c) Bluetooth
d) Satellite

P a g e 2 | 11
13. Command to remove the row(s) from table student is 1
a)drop table student
b)drop from student;
c)remove from student
d)delete from student

14. The following SQL is which type of join: 1


SELECT CUSTOMER_T. CUSTOMER_ID, ORDER_T. CUSTOMER_ID, NAME, ORDER_ID
FROM CUSTOMER_T,ORDER_T WHERE CUSTOMER_T. CUSTOMER_ID = ORDER_T.
CUSTOMER_ID ;
a) Equi-join
b) Natural join
c) Outer join
d) Cartesian product
15. The aggregate functions can only be used in the select list or _______ clause of a select query. 1

16. In order to open a connection with MySQL database from within Python using 1
mysql.connector package, ________ function is used.

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
17. Assertion(A): The readline( ) method reads one complete line from a text file. 1
Reason(R): The readline( ) method reads one line at a time ending with a newline(\n).
It can also be used to read a specified number (n) of bytes of data from a file but maximum up to
the newline character(\n)

18. Assertion(A): Keyword arguments are related to function calls. 1


Reason(R): When you use keyword arguments in a function call, the caller identifies the
arguments by the values passed.

SECTION B
(Q19-Q25) 7X2=14 Marks
19. Rewrite the following Python program after removing all the syntactical errors (if any), 2
underlining each correction:

20. Why do we need to network our systems? 2


(OR)
How is Coaxial cable different from Optical Fibre?

P a g e 3 | 11
21. Shristi has written a Python program to add all the numbers of the list. Her code is having errors. 2
Rewrite the correct code and underline the corrections made.

22. What is the similarity and difference between UNIQUE and PRIMARY KEY constraints? 2
23. Compare the following: 1
a. Hacker/Cracker 1
b. IP Address/MAC Address
24. Write the output of the given code: 2

[OR ]

25. Write any two aggregate functions in SQL with an appropriate example. 2
[OR ]
Write two commands each of DDL and DML commands in SQL

P a g e 4 | 11
SECTION C
(Q26-Q30) 5X3=15 marks
26. Consider the following tables FACULTY and COURSES and give outputs for SQL queries 3
(i) to (iii)

27. Write a method COUNTLINES() in Python to read lines from text file ‘TESTFILE.TXT’ 3
and count the number of lines which are starting with capital letter.

Example:
If the file content is as follows:
An apple a day keeps the doctor away.
we all pray for everyone’s safety.
A marked difference will come in our country.
The COUNTLINES() function should display the output as:
The number of lines starting with any vowel -1

[OR]

Write a function COUNTTEXT( ), which reads a text file Book.txt and displays all
the words of the file whose length is more than 3 or those which start with ‘A’ or ‘a’
in the form of a list.
For example, if the Book.txt file contains
India is my country. They are studying.
then the output should be:
[“India”, “country”, “They”, “are”, “studying”]

P a g e 5 | 11
28. Write output for (i) to (iii) based on the tables ‘Watches’ and ‘Sale’ given below. 3
Table : Watches

Table : Sale

i. select quarter, sum(qty_sold) from sale group by quarter;

ii. select watch_name,price,type from watches w, sale s wherew.watchid!=s.watchid;

iii. select watch_name, qty_store, sum(qty_sold), qty_store-sum(qty_sold) “Stock”


from watches w, sale s where w.watchid=s.watchid group by s.watchid;

29. Write a function GENERATE_INDEX(L), where L is the list of elements passed as 3


argument to the function. The function returns another list named ‘NewIndex’ that
stores the indices of all even Elements of L.

For example: If L contains [22,7,9,24,6,5]

The NewIndex will have - [0, 3, 4]

30. Write a Python function CREATESTACK(L), which should create two lists SO and SE from the 3
list L containing integers. The stack SO should contain all the odd elements of the list L, and the
stack SE should contain all the even elements of the list L.

Also, write a function POPSTACK( ) which should pop and print all the elements of the stack SE,
and print stack empty at the end.

For example, if the list L is [2,7,9,15,14]


Then SO should be [7,9,15]
SE should be [2,14]
Output of POPSTACK( ) function should be 14 2 Stack Empty

[OR]

P a g e 6 | 11
Write a Python function MYSTACK(d), which should accept a dictionary d of the form roll :
name as argument. The function should create a stack MYNAME having all the names
containing ‘s’ or ‘S’.
Also, write a function POPSTACK( ) which should pop and print all the elements of the stack
MYNAME, and print stack empty at the end.

For example, if the dictionary d is {1: ‘Sunil’, 2:’Naman’, 3:’Anish’}

Then MYNAME should be [‘Sunil’, ‘Anish’]

Output of POPSTACK( ) function should be Anish Sunil Stack Empty

SECTION D
Q31-Q33 3 X 5=15 marks
31. Ionex Private Ltd. Patna has different divisions Marketing (A1), Sales (A2), Finance 5
(A3) and Production (A4). The company has another branch in New Delhi. The
management wants to connect all the divisions as well as all the computers of each
division (A1, A2, A3, A4) of Patna branch.

Distance between the divisions are as follows :

A3 to A1: 20 m
A1 to A2: 35 m
A2 to A4: 20 m
A4 to A3: 130 m
A3 to A2: 1000 m
A1 to A4: 190 m

The number of computers in each division is as follows :


A1: 50
A2: 40
A3: 110
A4: 60

Based on the above configurations, answer the following questions :


(i) Suggest the type of network (PAN, LAN, MAN, WAN) required to connect the
Finance (A3) division with the New Delhi branch by giving suitable reasons.

(ii) Suggest the placement of following devices (a) Switch (b) Repeater

(iii) Suggest the division which should be made server by quoting suitable reasons.

(iv) The company wants to conduct an online video conference between employees
of the Patna and New Delhi branches. Name the protocol which will be used to send
voice signals in this conference.

(v) Suggest the topology and draw the most suitable cable layout for connecting all
the divisions of the Patna branch.

P a g e 7 | 11
32. 5

[OR]

a) Predict the output of below given Python code:


s="Abc2@xYz"

P a g e 8 | 11
33. Write one application of a csv file. A csv file Employee.csv has three columns [EmpID, Name, 5
Salary].

(i) Write a user defined function writecsv(L) which accepts a list L from the user
containing EmpID, Name, Salary and write it to the csv file Employee.csv.

(ii) Write a function readcsv(name)which accepts the employee name as parameter


and prints the salary of that employee.

[OR]

Write one advantage of binary file over csv file. A csv file Shop.csv has three columns [ItemID,
Item, Amount].

(i) Write a user defined function countcsv() which counts the number of items in the
csv file whose amount exceeds Rs 1000.

(ii) Write a function searchcsv(Item)which accepts the Item name as parameter and
prints the amount of that Item.

A csv file widely used in data analysis because of it structured nature.

P a g e 9 | 11
SECTION E
Q34-Q35 2X4=8 Marks

34. 4

Write SQL queries for the following:

i. Display Kitchen and Living items in descending order of Price


ii. Display the average price for each Type.
iii. (a) Display the Stockdate for recently added item.
(b) Display the Itemname whose name ends with ‘S’.

[OR]
(Option for part iii only)

(a) Delete the Item having price les than 10000.


(b) Update the price of item having NULL price to 1000.

P a g e 10 | 11
35. 4

ALL THE BEST

P a g e 11 | 11

You might also like