0% found this document useful (0 votes)
23 views10 pages

CS-Home Test1.

Cs imp questions for boards 12th

Uploaded by

afzalhu0540a
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)
23 views10 pages

CS-Home Test1.

Cs imp questions for boards 12th

Uploaded by

afzalhu0540a
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/ 10

CLASS XII

COMPUTER SCIENCE (083)


HOME TEST QP
Time allowed: 3 hours Maximum Marks: 70

General Instructions:
(i) This question paper contains five sections, Section A to E.
(ii) All questions are compulsory.
(iii) Section A have 21 questions carrying 01 mark each.
(iv) Section B has 07 Very Short Answer type questions carrying 02 marks each.
(v) Section C has 03 Short Answer type questions carrying 03 marks each.
(vi) Section D has 04 Long Answer type questions carrying 04 marks each.
(vii) Section E has 02 questions carrying 05 marks each.
(viii) All programming questions are to be answered using Python Language only.

SECTION – A (21 X 1=21)


1. . State True or False: 1
The operator ! is the arithmetic operator in Python.

2 Identify the valid identifier name from the following 1


(a) 9if (b)roll-no (c) sub (d) roll*no
3 Identify the output of the following code snippet: 1
t = ‘welcome to Python’
t =t,tittle()
print(t)

(a) ‘Welcome To Python’ (b) ‘Welcome to Python’


(c)’Welcome’, ’to’, ’Python’ (d) ‘welcome to python’

4 If s= ‘Computer Science’ then what will be the output of s.partition( ) 1


(a) [‘Computer’, ‘ ‘, ‘Science’] (b) (‘Computer’, ‘ ‘, ‘Science’)

(c) (‘Computer’, ‘Science’) (d) [‘Computer’, ‘Science’]

5 Evaluate the following expression: 1


(5**3+5)-10*3%3
(a) 0 (b)130 (c) 120 (d) 150
6 Identify the output of the following code snippet: 1
L =[ ]
for i in range(5)
L[0]=i
(a) [0,1,2,3,4] (b) Error
(c) [1,2,3,4,5] (d) All of the above

7 Which of the following statement will produce error if T = (10,20,30) 1

(a) print(T[2]=50) (b) print (len(T))


(c) print(list(T)) (d) print(T)

8 Which of the following is not a tuple in Python? 1


(a) (1,2,3) (b) (‘one’, ‘two’)
(c ) (10,) (d) (“one”)

9 Consider the given expression: 1


5<10 and 12<7 or not 7<4
Which of the following will be the correct output, if the given
expression is evaluated?
(a) True (b) False
(c) None (d) Null

10 Identify the output of the following Python statements? 1


L=[]
for i in range(4):
L.append(2*i+1)
print( L[: :-1])

(a) [9,7,5,3] (b) [7,5,3,1]


(c ) [4,3,2,1] (d) [1,2,34]

11 . Identify the correct possible output for the following Python code: 1
import random
for N in range(2,5,2):
print(random.randrange(1,N,end=’@’)
(a) 1@3@5@ (b) 2@3@
(c ) 1@4@ (d)1@3@

12 Which of the following is not correct in context of Positional and 1


Default parameters in Python functions?
(a) Default parameters must occur to the right of the Positional
parameters.
(b) Positional parameters must occur to the right of the Default
parameters.
(c )Positional parameters must occur to the left of Default parameters.
(d) All parameters to the right of Default parameters must also have
Default value.

13 Which SQL command can change the degree of an existing relation? 1


(a) Alter (b)Delete (c) Drop (d) Insert
14 What will be the output of the query? 1
SELECT * FROM Students WHERE Student_name LIKE ‘%A%’;
(a) Details of all the students whose name start with ‘A’.
(b) Details of all the students whose name ends with ‘A’.
(c) Details of all the students whose name containing ‘A’.
(d) Names of all the students whose name start with ‘A’.

15 . Which of the following is known as a set of entities of the same type 1


that share same properties or attributes?
(a) Relation set (b) Tuples
(c) Entity set (d) Entity Relation model.

16 Which command is used to removes a relation from an SQL? 1


(a) Drop table (b) Delete (c) Purge (d) Remove

17 What is the use of Bridge in the Network? 1


(a) To connect LANs (b) To separate LANs
(c) To control network speed (d) All of the above

18 Which transmission media is capable of having a much higher 1


bandwidth(data capacity)?
(a) Coaxial (b) Twisted pair cable
(c) Untwisted cable (d) Fiber optic

19 What is address size of IPv6? 1


(a) 32 bit (b) 64 bit
(c) 128 bit (d) 256 bit

Question no,20 and 21 are the 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.

20 Assertion: In non-circuit switching techniques, the message may take 1


different routes at different times.

Reason: The message switching and packet switching techniques are


the same.

21 Assertion: A series of object stores values of homogeneous types. 1


Reason: Even if the value appear to be of different types, internally
they are stored in a common datatype.

SECTION-B (7X2=14)
22. A) List out all the mutable and immutable data types in python.
B) Identify the types of following tokens. (2)

i) _Var_ ii) in

23. i) What is the use of Identity operator? Give an example.


(2)
ii) Explain the use of ceil() and fabs() functions of math module with
an example.
24. If exam=[‘eng’, ‘phy’, ‘che’, ‘cs’, ‘bio’], then
(Answer using builtin functions only)
(I)
A) Write a statement to insert subject ’math’ as last element (2)
OR
B) Write a statement to display the list in alphabetical order.
(II)
A) Write a statement to delete the element ‘che’.
OR
B) Write a statement to reverse the elements of list exam.

25. Identify the correct output(s) of the following code. Also write the
minimum and the maximum possible values of the variable t.

import random
W=[‘Pen’, ‘Pencil’, ‘Eraser’, ‘Bag’, ‘Book’]
for i in range(2,3):
(2)
f=random.randint(i,3)
t=random.randint(i-1,3)
print(W[f], W[t], sep= “:”)

26. A) Write any two differences between circuit switching and


packet switching.
OR (2)
B) Expand the following terms.
i) VoIP ii) GPRS iii) FTP iv) Wi-Fi

I)
27.
A)Differentiate WHERE and HAVING clause in SQL with an
example
OR (2)
B)Write any two differences between DELETE and DROP
commands.
II)
A) Satheesh has created a database “school” and table “student”.
Now he wants to view all the databases present in his laptop.
Help him to write SQL command for that, also to view the
structure of the table he created.
OR
B) Write an SQL command to add the new column
PURCHASE_DATE of an already existing table named
PRODUCT.

28. Observe the following code carefully and rewrite it after removing all
syntax and logical errors. Underline all the corrections made.
def sepo_n(NUM):
SUM=0 (2)
PROD=1
for j in range(10:NUM)
if j%2=0:
SUM=SUM+j
else:
PROD=*j
print(SUM,PROD)
N=input(“Enter a number”)
seop_n(N)
SECTION-C (3X3=9)
29 A) Write a function AICOUNT() in Python, which should read each 3
character of a text file “DETAILS.TXT” and then count and display the
count of occurrence of alphabets A and I individually (including small
cases a and i too).

Example:

If the file content is as follows:

I am getting better and better every day.

All I need is within me right now.

I am independent and self-sufficient.

The AICount() function should display the output as:

The total count of A or a: 6

The total count of I or i: 11

OR
B) Write a function CNT_DWORDS() in Python to count the words
ending with a digit in a text file "QUOTES.txt".

Example:

If the file content is as follows :

Planet51 Ocean’s 13,


500Days of Summer, House of1000 corpses
Blues Brothhers2000 3000Miles to Grace land

Output will be:


Number of words ending with a digit are 3

30 Write a program to reverse a string using stack. 3

31 A) Predict the output of the following code: 3

text = "pythoncode"
count = {}
c=0
lst = []
for w in text:
if w not in lst:
lst.append(w)
count[w] = 0
c= c + 1
count[w] = count[w] + 1
print(count)
print(lst)

OR

Predict the output of the following code:


def fun(N1,N2=10):
return N1 > N2
NUM= [10,21,14,56,32]
for I in NUM:
for J in range(1,I%5):
if J > len(NUM)//2:
print(fun(25),'#', end=' ')
else:
print(fun(30),'%',end=' ')

SECTION-D (4X4=4)
32. Consider the table EMPLOYEES as given below: 4
Emp_ID Name Department Salary Joining_Date
101 Amit IT 50000 2020-05-15
102 Nisha HR 60000 2019-07-10
103 Rohit IT 45000 2021-02-25
104 Riya Finance 55000 2018-11-23
105 Arjun Marketing 40000 2021-03-05
A) Write the following queries:
i) To display the total salary for each department, excluding
departments with a total salary greater than 100,000.
ii) To display the EMPLOYEES table sorted by salary in
ascending order.
iii) To display the distinct department names from the
EMPLOYEES table
iv) Display the total salary of employees whose joining date is
before 2020-01-01
OR
B) Write the output for the following queries:
i) SELECT name, salary from employees where salary
>50000;
ii) SELECT department, Count(*) as total_employees
FROM employees GROUP BY department;
iii) SELECT * FROM EMPLOYEES where
department=’IT’;
SELECT min(salary) from employees;

33 Write a program in Python that defines and calls the following user 4
defined functions:
i) add()-To add the data of a student to a CSV file ‘school.csv’.
Each record consists of a list with field elements as stuid,
sname and marks to store student id, student name and student
marks respectively.
ii) Search()- To display the records of the student whose marks
is more than 80.

34 Write SQL queries for (i) to (iv) on the basis of table ITEMS and 4
Traders
Table: ITEMS
CODE INAME QTY PRICE COMPANY TCODE
1001 Digital 120 11000 XENITA T01
pad
1006 Led 70 38000 SANTORA T02
screen
1004 Car 50 21500 GEOKNOW T01
Gps
system
1003 Digital 160 8000 DIGICLICK T02
Camera
1005 Pen 600 1200 STOREHOME T03
drive

TABLE: TRADERS
TCODE INAME CITY
T01 ELECTRONIC MUMBAI
SALES
T03 BUSY STORE CORP DELHI
T02 DISP HOUSE INC CHENNAI

i) To display the details of all the items in ascending order of


item names(i.e , INAME)
ii) To display item name and price of all those items whose
price is in the range of 10,000 and 22,000(both values
included)
iii) To display the number of items traded by each trader,
joining the items and traders tables.
iv) A) To increase the price of items by 10% whose quantity is
above 100.
OR
B) Write a query to display the Cartesian product of
ITEMS and TRADERS

35 Consider the following table MEMBER in a SQL , Database CLUB: 4


Table: MEMBER
M_ID NAME ACTIVITY
M1001 Amina GYM
M1002 Pratik GYM
M1003 Simon SWIMMING
M1004 Rakesh GYM
M1005 Avneet SWIMMING
Write Python code to display the M_ID and NAME of members whose
activity is “GYM”
Use the following information for the connection:
host: localhost
database:club
userid:admin
password:admin@123
tablename:member

SECTION-E (2X5=10)
36 A binary file “Book.dat” has structure [Bookno, Book_name, 5
Author,Price].

(i) Write a user defined function createfile(). To input data for a record
and add to Book.dat

(ii) Write a function countrec(Author) in Python which accepts the


Author name as parameter and count and return number of books by the
given Author are stored in the binary file Book.dat
37 “Pratham” an NGO ,to provide education to children in the slums of 5
Mumbai and it has grown both in scope and geographical area,It is
planning to setup its new campus at Gujarat . The Gujarat campus has
four(04) UNITS as shown below:
ADMIN TRAINING
UNIT UNIT

FINANCE RESOURCE
UNIT UNIT

Distances between above UNITs are given under:

UNIT-1 UNIT-2 DISTANCE(in mtrs)


ADMIN TRAINING 75
ADMIN RESOURCE 130
ADMIN FINANACE 100
FINANACE TRAINING 60
FINANACE RESOURCE 45
TRAINING RESOURCE 60

No.of computers in various units are:

UNIT NO.OF.COMPUTERS
ADMIN 140
FINANACE 25
TRAINNG 80
RESOURCE 65

i) Suggest an ideal cable layout for connecting the above UNITs.


ii) Suggest the most appropriate location of the server (out of the
4 units), to get the best and effective connectivity .Justify your
answer.
iii) Which hardware device will you suggest to connect all the
computers within each unit?
iv) A considerable amount of data loss is noticed between the
different locations of the Gujarat division, which are
connected to the network .Suggest a networking device that
should be installed to refresh the date and reduce the data loss
during transmission to and from different locations of Gujarat
division.
v) A) Suggest the most suitable media to provide secure,fast and
reliable data connectivity between Mumbai Head Office and
the Gujarat Setup.

OR
B) Mumbai firm is planning to connect to its Finance
department in Gujarat which is approximately 500 km away.
Which type of network out of LAN,WAN or MAN will be
formed ?Justify your answer

You might also like