Question: 1-- A function that returns an integer value grater than 0 is called a boolean function. Select one: True False 2-- Encapsulation is the process
1-- A function that returns an integer value grater than 0 is called a boolean function.
Select one:
True
False
2-- Encapsulation is the process of wrapping a piece of code in a function
Select one:
True
False
3-- Repeated execution of a set of programming statements is called repetitive execution.
Select one:
True
False
4-- A development approach that that is intended to avoid a lot of debugging by only adding and testing small amounts of code at a time is called.
Select one:
a. structured development
b. incremental development
c. unit testing
d. Systems development life cycle
5-- What output will the following code produce?
def area(l, w):
temp = l * w;
return temp
l = 4.0
w = 3.25
x = area(l, w)
if ( x ):
print (x)
Select one:
a. 13.0
b. 0
c. Expression does not evaluate to boolean true
d. 13
6-- What output will the following code produce?
n = 10
while n != 1:
print (n,)
if n % 2 == 0: # n is even
n = n // 2
else: # n is odd
n = n * 3 + 1
Select one:
a. 10 5 16 8 4 2
b. None an error will be displayed
c. 8 4 2
d. 9 28 14 7 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2
7-- What output will the following statements produce using Python IDLE in interactive mode?
>>> n = 2
>>> n += 5
>>> n
Select one:
a. 7
b. 5
c. 2
d. an error message will occur
8-- The statements inside of a loop are known as the ____ of the loop.
Select one:
a. body
b. expression
c. counter
d. block
9-- A loop where the terminating condition is never achieved is called an _______
Select one:
a. infinite loop
b. universal loop
c. while loop
d. for .. ever loop
10-- Functions can only return Boolean expressions.
Select one:
True
False
11-- With built in functions, it is generally acceptable to take a "Leap of Faith".
Select one:
True
False
12-- "Dead code" is code that performs calculations but never displays the results.
Select one:
True
False
13-- Boolean expressions control _________________
Select one:
a. recursion
b. conditional execution
c. alternative execution
d. all of the above
14-- The modulus operator is the same as the divide operator.
Select one:
True
False
15-- Chained conditionals are used when there are three or more possibilities.
Select one:
True
False
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
