Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Chem

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

SUBBIAH CENTRAL SCHOOL

TERM I EXAMINATION (SEPTEMBER 2024)


Subject: - Computer Science Max Marks: 70
Grade: - XI Time: 3 Hours
General Instructions:
1. This question paper contains five sections, Sections A to E.
2. All questions are compulsory.
3. Section A has 21 questions carrying 01 mark each.
4. Section B has 07 Very Short Answer type questions carrying 02 marks each.
5. Section C has 03 Short Answer type questions carrying 03 marks each.
6. Section D has 04 questions carrying 04 marks each.
7. Section E has 02 questions carrying 05 marks each.
8. All programming questions are to be answered using Python Language only.
Section - A
1 According to Boolean laws: A + 0 = ____? 1
a) 1 b) A c) 0 d) A
2 Prutha is trying to convert a string literal ‘3’ into an integer. But she is confused about 1
which function out of the following is used to do so? Help her to do the right choice
for her work.
a) integer b) number c) int d) num
3. The given hexadecimal number (1E.53)16 is equivalent to : 1
1. (35.684)8 2. (36.246)8 3. (34.340)8 4. (35.599)8
4 The input() returns the value as _____ type. 1
(a) integer (b) string (c) floating point (d) none of these
5 What is the value of the expression 100/25 ? 1
(a) 4 (b) 4.0 (c) 2.5 (d) none of these
6 Which of the following is not an immutable type in Python? 1
(a) String (b) Tuples (c) Set (d) dictionary
7 _____ are the symbols that trigger some computation or action. 1
8 Special meaning words of Pythons, fixed for specific functionality are called _____.
(a) Identifiers (b) functions (c) Keywords (d) literals 1
9 Which Python built-in function returns the unique number assigned to an object? 1
(a) identity() (b) id() (c) refnum() (d) ref()
10 What is Python? 1
a. A type of snake b. A high-level programming language
c. A type of data structure d. A software development company
11 Predict the output: 1
A=10
while(A>5):
print(A,end=” “)
A=A-1
12 The _____ literals is used to indicate absence of value. 1
a. int b. True c.None d. string
13 Which of the following is valid identifier? 1
a) None b) #None c) 0_None d) none
14 Which one is not an output Device? 1
a. Monitor b. Keyboard c. Speaker d. Printer
15 Which amongst this is not an octal number? 1
a) 645 b) 234 c) 876 d) 123
16 According to the associative law: 1
a) A+B=B+A b) A=A+A c) (A+B)+C=A+(B+C) d) A+0=A
For Q.No 17 and 18 choose the appropriate option
i. Both A and R are true and R is the correct explanation for A
ii. Both A and R are true and R is not the correct explanation for A
iii. A is True but R is False iv. A is false but R is True v. Both A and R are false
17 Assertion: In Python, variables must be declared with a data type before they can be 1
used.
Reasoning: Python is a dynamically typed language, which means you do not need
to explicitly declare a data type for a variable before using it. The interpreter
determines the data type based on the value assigned to the variable.
18 Assertion: In Python, the 'input()' function always returns a string.
Reasoning: The 'input()' function returns the user's input as a string. If you need a 1
different data type, you should explicitly convert it using type casting.
19 When the following code runs, how many times is the line executed? "x = x * 2"
x=1
while (x < 20) : 1
x=x*2
(a) 2 (b) 5 (c) 19 (d) 4 (e) 32
20 What is the correct definition of an algorithm?
a) An algorithm is a step-by-step instruction to solve a problem.
b) An algorithm is a process of baking bread. 1
c) An algorithm is software used to compute numbers.
d) An algorithm is the process of breaking problems.
21 What will be the output of the following python code:
c=0
for i in range(5):
if(i%2==0): 1
c=c+2
if(i%4==0):
c+=3
print(c)
SECTION - B
22 Define: Hardware & Software with suitable example. 2
23 Using truth table, prove that: 2
AB+BC+C = AB+C
24 Convert the following binary numbers to decimal: 2
(i) 10110 (ii) 1010100.011
25 State a Truth Table for AND, OR, NOT Gates. 2
26 Draw the logic circuit diagram for the following expression: 2
(i) XYZ’ + Y.(X+Z’)

(ii) AB’ + C’D’


27 i)

ii) Find the output:


28 i. What function is implemented by the circuit shown in the below figure.

ii. Draw the logic circuit diagram for expression: AB’+B’C’+ABC

SECTION - C
29 i. Convert: a) (1234.56)10 = (?)16 3
b) (476)8 = (?)2
ii. Arrange the following in ascending order of memory capacity:
TB , Byte, KB, Nibble, PB, MB, GB
30 Predict the output of the following code fragments:
i)
x = 10
y=0
while x > y:
print (x, y)
x=x-1
y=y+1 3

ii)
keepgoing = True
x=100
while keepgoing :
print (x)
x = x - 10
if x < 50 :
keepgoing = False
31 i. Evaluate the following expressions:
a) 6 * 3 + 4**2 // 5 – 8
b) 10 > 5 and 7 > 12 or not 18 > 3
3
ii. Find and write the output of the following python code:
x=”abcdef”
i=”a”
while i in x:
print(i, end=” “)
SECTION - D
32 i. What is the output produced by the following code? ii. Predict the output of the
x=1 following code fragments:
if x > 3 : (a)
if x > 4 : count = 0
print ("A", end = ' ') while count < 10 :
else : print ("Hello") 4
print ("B", end = ' ') count += 1
elif x < 2:
if (x != 0) : (b)
print ("C", end = ' ') x = 10
print ("D") y=5
for i in range (x - y * 2) :
print ("%", i)
33 i. What is the output of the following lines of code? If ii. What is following code
it returns error how will you correct it? doing? What would it print
if int('zero') == 0 : for input as 3?
print ("zero") n = int (route "Enter an 4
elif str(0) == 'zero' : integer : "))
print (0) if n < 1 :
elif str(0) == '0' : print ("invalid value")
print (str(0)) else :
else : for i in range (1, n + 1) :
print ("none of the above") print (i * i)
34 Expressions in programming are like formulas in mathematics: both use values (in
Python literals and names bound to values) to compute a result. But unlike
mathematics, expressions in Python can compute results of a wide variety of types
(e.g., boolean and string) not just mathematical results. We classify these operators,
both symbols and identifiers, into four categories and examine them separately:
Arithmetic (+ -* / // % **), Relational: (== != < > <= >= is in), Logical (and not or), and
finally Bitwise (& | ~ ^ << >>) When two or more operators share an operand with
the same precedence, such as a * b / c, the expression is evaluated according to
associativity. When all of the operators in an expression have the same precedence, the
expression is evaluated using left to right associativity. Now, since the ** operator has
right-to-left associativity, a ** b ** c will be evaluated as a ** (b ** c). For exponentiation,
the expression on the right is evaluated first. On the other hand, since the * operator 4
has left-to-right associativity, a * b * c is treated as (a * b) * c. For multiplication, the
expression on the left is evaluated first.
i.
if a =1 and b =2 and c =3 then a **b ** c evaluate to :
a) 1 b) 8 c) 9 d) 15

ii.
if a= 3 and b = 5 then ( a > b and b>a) evaluate to :
(a)True b) False c) True and True d) None of these

iii.
% is known as the modulus operator and if a =13 and b =2 then a % b evaluate to __.
(a) False , 0 b) True , 6 c) True , None d) None of These

iv. Out of following which is not a bitwise operator :


(a) << (b)>> (c) & d) None of These (d) >=
35 (a) Under what conditions will this code fragment print "water"?

if temp < 32 :
print ("ice")
elif temp < 212 : 4
print ("water")
else :
print ("steam")

(b) What is the error in following code? Correct the code:


weather = 'raining'
if weather = 'sunny' :
print ("wear sunblock")
elif weather = "snow" :
print ("going skiing")
else :
print (weather)
SECTION - E
36. Find the output (ii) (iv) (v)
of the following for i in i = 0; sum = 0 for x in range(1,4):
program range(20,30,2): while i < 9: for y in range(2,5):
segments: print(i) if i % 4 == 0: if x * y > 10:
(i) sum = sum + i break
a = 110 i=i+2 print (x * y)
while a > 100: print (sum)
print(a) (iii)
a -= 2 country = 'INDIA' 5
for i in country:
print (i)

OR
b. (i)What is the purpose of range() function? Give one example. (2 ½ )

(ii) Write a function to print the table of a given number. The number has to be
entered by the user. (2 ½)
37. Write the output of (b)
the following: (3) num1, num2 = 2, 6
(a) num1, num2 = num2, num1 + 2 (d) Write a program to enter
num1 = 4 print (num1, num2) two integers and perform all
num2 = num1 + 1 arithmetic operations on
num1 = 2 them. (2)
print (num1, num2) (c)
num1, num2 = 2, 3
num3, num2 = num1, num3 + 1
print (num1, num2, num3)

OR
Find the errors: 5
(a) (c) (e)
name = "HariT" print (type (int('123'))) print ("Hello" + 2)
print (name) print (type(int ("Hello"))) print ("Hello" + '2')
name[2] = 'R' print (type (str("123.0"))) print ("Hello" * 2)
print (name)
(d)
(b) pi = 3.14
a = bool(0) print (type (pi))
b = bool(1) print (type ("3.14"))
print (a == false) print (type (float ("3.14")))
print (b == true) print (type (float("three point
fourteen")))

You might also like