Troy Bowlin
Quiz by , created more than 1 year ago

AS - Level Computer Science (CS 1101 Python) Quiz on CS1101 Week 6, created by Troy Bowlin on 05/18/2016.

328
1
0
Troy Bowlin
Created by Troy Bowlin almost 8 years ago
Close

CS1101 Week 6

Question 1 of 15

1

A function that returns an integer value greater than 0 is called a Boolean function.

Select one of the following:

  • True
  • False

Explanation

Question 2 of 15

1

Encapsulation is the process of wrapping a piece of code in a function

Select one of the following:

  • True
  • False

Explanation

Question 3 of 15

1

Repeated execution of a set of programming statements is called repetitive execution.

Select one of the following:

  • True
  • False

Explanation

Question 4 of 15

1

A development approach 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 of the following:

  • structured development

  • incremental development

  • unit testing

  • systems development life cycle

Explanation

Question 5 of 15

1

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 of the following:

  • 13.0

  • 0

  • expression does not evaluate to Boolean true

  • 13

Explanation

Question 6 of 15

1

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 of the following:

  • 10 5 16 8 4 2

  • none an error will be displayed

  • 8 4 2

  • 9 28 14 7 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2

Explanation

Question 7 of 15

1

What output will the following statements produce?

n=2
n+=5
print(n)

Select one of the following:

  • 7

  • 5

  • 0

  • none

Explanation

Question 8 of 15

1

The statements inside of a loop are known as the _____ of the loop.

Select one of the following:

  • body

  • expression

  • counter

  • block

Explanation

Question 9 of 15

1

A loop where terminating condition is never achieved is called an _____.

Select one of the following:

  • infinite loop

  • universal loop

  • while loop

  • for .. ever loop

Explanation

Question 10 of 15

1

Functions can only return Boolean expressions.

Select one of the following:

  • True
  • False

Explanation

Question 11 of 15

1

With built in functions, it is generally acceptable to take a "Leap of Faith".

Select one of the following:

  • True
  • False

Explanation

Question 12 of 15

1

"Dead Code" is code that performs calculations but never displays the results

Select one of the following:

  • True
  • False

Explanation

Question 13 of 15

1

Boolean expressions control _____.

Select one of the following:

  • recursion

  • conditional execution

  • alternative executive

  • all of the above

Explanation

Question 14 of 15

1

The modulus operator is the same as the divide operator.

Select one of the following:

  • True
  • False

Explanation

Question 15 of 15

1

Chained conditionals are used when there are three or more possibilities.

Select one of the following:

  • True
  • False

Explanation