Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

SET – B

FIRST TERM EXAMINATION- (2022-23)


SUBJECT – COMPUTER SCIENCE
CLASS -XII
Duration 3 hrs. MM. 70
SECTION A
Q1. All parts are compulsory. 1X10=10
1. Find the invalid identifier from the following
1. sun@gmail 2. _incometax
3. Total 4. Number
2. Which of the following will give output as [23,2,9,75] .If L=[6,23,3,2,0,9,8,75]
1. print(L[1:7:2]) 2. print(L[0:7:2])
3. print(L[1:8:2]) 4. print(L[0:8:2])
3. Which of the following operator cannot be used with string data type?
1. ** 2. * 3. + 4. /
4. Consider a tuple T = (10, 15, 25, and 30). Identify the statement that will result in an
error.
1. print(T[2]) 2. T[3] = 19
3. print(min(T)) 4. print(len(T))
5. Identify the output of the following Python statements.
L= [10, 15, 20, 25, 30]
L.insert( 3, 4)
L.insert( 2, 3)
print (L[-5])
1. 2 2. 3 3. 4 4. 20
6. Identify the valid logical operator in Python from the following.
a) and b) in c) not d) Boolean
7. Write the names of two arithmetic functions which does not required any module?
8. What is the output of the following code?
A=10
def F():
a=5
b=20
print(a)
print(a)
9. Write the statement to read the 02 characters of the file from a file object F.
10. Which string method is used to implement the following:
a) To count the number of characters in the string.
b) To check whether given character is letter or a number.
SECTION -B
Q2. Rewrite the following code in python after removing all syntax error(s). Underline each
correction done in the code.

a) (2)
DEF calc(Val)
Adder= 0
for C in range(1,Val,3)
Adder =+ C
if C%2 = 0:
Print C*10
Else: Print C*
print (Adder)

a= int(input(“Value”))
calc(a)

b) (2)
x=input(“Enter a number”)
if(fabs(x)=x):
print(“You entered a positive number”)
Else:
x=*-1
print(“Number made positive ”,x)

Q3. Find the output of the following programs: (2X3=6)


a) def Changer(P,Q=10):
P=P/Q
Q=P%Q
print (P,"#",Q)
return P
A=200
B=20
A=Changer(A,B)
print (A,"$",B)
B=Changer(B)
print (A,"$",B)
A=Changer(A)
print (A,"$",B)
b) NUM = 1234543;
F=0
S=0
while(NUM>0):
R = NUM% 10;
if (R % 2 !=0):
F+ =R
else:
S+ = R
NUM//=10;
print(S - F)

c) import random
High =4
Guess=random,randrange(0,High)+50
forC in range (Guess,56):
print(C,end= “#”)

#Output Options:

i. 50#51#52#53#54#55 ii. 52#53#54#55#


iii.53#54# iv. 51#52#53#54#55#

Q4. Output Questions:


a) def Printdata( ): (3)
Msg1="WeLcOME"
Msg2="GUeSTs"
Msg3=""
for I in range(0,len(Msg2)+1):
if Msg1[I]>="A" and Msg1[I]<="M":
Msg3=Msg3+Msg1[I]
elif Msg1[I]>="N" and Msg1[I]<="Z":
Msg3=Msg3+Msg2[I]
else:
Msg3=Msg3+"*"
print (Msg3)

Printdata()

b) def get(x,y,z): (3)


x+=y
y-=1
z*=(x-y)
print(x,’#’,y,’#’,z)
def put(z,y,x):
x*=y
y+=1
z*=(x+y)
print(x,’$’,y,’$’,z)
a=10
b=20
c=15
get(b,c,a)
put(a,c,b)
get(a,b,c)

c) val = 100 (4)


def display(N):
val = 50
if N%14==0:
val = val - N
else:
val = val + N
print(val, end="@")

display(40)
print(val)
Q5.
1. Differentiate between default arguments and keyword arguments with example. (2)
2. Differentiate between readline( ) and readlines( ) with example (2)
3. Evaluate : (2)
i. 6 * 3 + 4**2 // 5 – 8
ii. 10 > 5 and 7 > 12 or not 18 > 3
4. Write flow of execution of the following program (2)

5. Write the statement to (2)


a. Write 3 lines in a file “poem.txt “ using writelines().
b. Open a binary file “stud.dat “in read mode.
Q6.
a) Write a program which will create 3 modules, rect.py that finds the area of rectangle,
sq.py that finds area of square, tri.py that finds area of triangle and mainarea.py to
import 3 modules to call respective functions (3)

b) Consider the a Binary file “Emp.Dat‟ has structure (empid,name salary) , Write a
function RECSHOW() to display only those records who are earning less han 5000.
(3)
c) Write a function in python to count as well as display words which are of length 3 in
“POEM.txt” (2)

d) Write a function in python to read lines from file “Article.txt” and display all those
words, which are starting with uppercase vowels. (2)

SECTION C
Q7.
1. Define Web Hosting. (2)
2. Define Cyber Crime. Your friend Mohini complaints that somebody has created a
fake profile on Facebook and defaming her character with abusive comments and
pictures. Identify the type of Cyber Crime for these situations. (2)

3. What is protocol? Which protocol is used to allows users to download E- Mail messages
from mail server to a local computer ? (2)
4. Define topology. Write two disadvantages of BUS topology (2)
5. Expand the following terms : (2)
(a) SLIP (b) EDGE (c) GSM (d) NNTP
6. Compare twisted pair cables with coaxial cables. (2)
7. What is baud. Write its unit. (2)
8. Answer the questions (i) - (vi) based on given information. (6)
“Learn Together” is an educational NGO. It is setting up its new campus at Jabalpur
for its web based activities. The campus has 4 compounds as shown in the diagram
below:
Center to center distance between various Compounds as per architectural drawings
(in Metre) is as follows:

 Main Compound to Resource Compound 110 m


 Main Compound to Training Compound 115 m
 Main Compound to Finance Compound 35 m
 Resource Compound to Training Compound 25 m
 Resource Compound to Finance Compound 135 m
 Training Compound to Finance Compound 100 m

Expected Number of Computers in each Compound is as follows:

 Main Compound 5
 Resource Compound 15
 Training Compound 150
 Finance Compound 20

(i) Suggest a cable layout of connections between the compounds.

(ii) Suggest the most suitable place (i.e., compound) to house the server for this NGO.
Also, provide a suitable reason for your suggestion.

(iii) Suggest the placement of the following devices with justification:

(i) Repeater

(ii) Hub/Switch

(iv) The NGO is planning to connect its International office in Mumbai, which out of
the wired communication links, will you suggest for very high speed connectivity?

(v) The NGO is also planning to connect its office in hilly region , which out of the
communication links, will you suggest for connectivity?

(vi) NGO is taking internet using telephone lines which device is required and where
it should be placed.

You might also like