Computer Science (Class-XII) QP - 1
Computer Science (Class-XII) QP - 1
3. Which of the following will be correct output if the given expression is evaluated?
>>> not True and False or True
(1)
(a) True (b) False (c) NONE (d) Null
9. If a table which has one Primary key and three alternate keys. How many Candidate keys
will this table have?
(1)
(a) 3 (b) 4 (c) 5 (d) 6
10. Identify the missing part in the code to write the list object in the file
>>> import pickle
>>> x=[1,3,5,7]
>>> f=open('w.dat','wb')
>>> pickle. ___________(x,f) (1)
>>> f.close()
16. All aggregate functions ignore NULLs except for ________ function.
(1)
(a) Distinct (b)Count(*) (c) Average( ) (d) None of these.
18. Which of the following device an interface between computer and network?
(1)
(a) Modem (b) Router (c) Ethernet Card (d) Repeater
19. Which switching technique dedicated channel through the network? (1)
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 (1)
(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) : If the arguments in function called statement match the number and order of
argument as defined in the function definition, such argument are called
(1)
positional arguments.
Reasoning(R): During a function called, the argument list first contain default arguments
followed by positional arguments.
21. Assertion (A): The HAVING clause can only be used with a GROUP BY statement.
Reasoning(R): WHERE clause can be used in place of HAVING clause in (1)
GROUP BY statement.
Q .No. Section-B (7 x 2 = 14 Marks)
Marks
22. What are immutable and mutable types? List immutable and mutable types of Pyhton?
(2)
23. Give two examples of each of the following:
(2)
(i) Keywords (ii) Membership operators.
24. Start with the list [8, 9, 10]. Do the following using list functions:
(i) Write a statement to set the second entry (index 1) to 17 .
OR
Write a statement to remove the first entry from the list. (2)
(ii) Write a statement to add 4, 5 and 6 to the end of the list.
OR
Write a statement to sort the given list.
25.
Consider the following code and find out the possible output(s) from the options given
below. Also write the least and highest value that can be generated.
import random as r
print(1 + r.randint(1 ,1 ) , end = ‘ ‘)
(2)
print(1 + r.randint(1 ,1 ) , end = ‘ ‘)
print(1 + r.randint(1 ,1 ) , end = ‘ ‘)
print(10 + r.randint(10,15))
(2)
28. What is difference between star topology and bus topology of network?
OR (2)
Expand the term IMAP. What is the use of IMAP?
(3)
OR
Predict the output of the following code:
d = {"apple": 25, "banana": 48, "cherry": 83}
str1 = ""
for key in d:
str1 = str1 + str(d[key]) + "@" + “\n”
str2 = str1[:-1]
print(str2)
Q. No. Section-D (4 x 4 = 16 Marks)
Marks
32. Consider the table GRADUATE given below.
(4)
(a) Write SQL Command for the following:
(i) List the names of those students who have obtained DIV I sorted by NAME.
(ii) Display a report, listing NAME, STIPEND, SUBJECT and amount of stipend received
in a year assuming that the STIPEND is paid every month.
(iii) To count the number of students who are either PHYSICS or COMPUTER SC
graduates.
(iv) To insert new row in the GRADUATE table 11,”KAJOL”, 300 , “computer sc”, 75 , 1
OR
(b) Give the output of following sql statement based on table GRADUATE:
33. Write a Program in Python that defines and calls the following user defined functions :
(a) add( ): To accept and add data of an employee to a CSV file 'furdata.csv'. Each record
consists of a list with field elements as fid, fname and fprice to store furniture
(4)
id, furniture name and furniture price respectively.
(b) search( ): To display the records of the furniture whose price is more than 10000.
34. Consider the following table GARMENT and FABRIC :
TABLE : GARMENT
FCODE TYPE
F04 POLYSTE
F02 COTTON
F03 SILK
F01 TERELENE
(4)
Note: The following to establish connectivity between Python and MySQL:
• Username - root • Password – admin • Host – localhost
The values of fields rno, name, DOB and fee has to be accepted from the user.
Help Shuvam to write the program in Python.
(i) Write a function to input the data of a candidate and append it in a binary file.
(ii) Write a function to update the data of candidates whose experience is more than 10
years and change their designation to "Senior Manager".
(iii) 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. MyPace University is setting up its academic blocks at Naya Raipur and is planning to set
up a network. The University has 3 academic blocks and one Human Resource Center as
shown in the diagram below:
(5)
Center to Center distances between various blocks/center is as follows:
(a) Suggest the most suitable place (i.e., Block/Center) to install the server of this
University with a suitable reason.
(b) Suggest an ideal layout for connecting these blocks/centers for a wired connectivity.
(c) Which device will you suggest to be placed/installed in each of these blocks/centers to
efficiently connect all the computers within these blocks/centers.
(d) Suggest the placement of a Repeater in the network with justification.
(e) (i)The university is planning to connect its admission office in Delhi, which is more than
1250km from university. Which type of network out of (LAN, MAN, or WAN) will be
formed?
OR
(ii) What would be your recommendation for enabling live visual communication
between the Business Block and HR Centre from
the following options:
(a) Video Conferencing (b) Email (c) Telephony (d) Instant Messaging