Troy Bowlin
Quiz por , criado more than 1 year ago

AS - Level Computer Science (CS 1101 Python) Quiz sobre CS1101 Week 6, criado por Troy Bowlin em 18-05-2016.

328
1
0
Troy Bowlin
Criado por Troy Bowlin aproximadamente 8 anos atrás
Fechar

CS1101 Week 6

Questão 1 de 15

1

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

Selecione uma das opções:

  • VERDADEIRO
  • FALSO

Explicação

Questão 2 de 15

1

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

Selecione uma das opções:

  • VERDADEIRO
  • FALSO

Explicação

Questão 3 de 15

1

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

Selecione uma das opções:

  • VERDADEIRO
  • FALSO

Explicação

Questão 4 de 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.

Selecione uma das seguintes:

  • structured development

  • incremental development

  • unit testing

  • systems development life cycle

Explicação

Questão 5 de 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)

Selecione uma das seguintes:

  • 13.0

  • 0

  • expression does not evaluate to Boolean true

  • 13

Explicação

Questão 6 de 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

Selecione uma das seguintes:

  • 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

Explicação

Questão 7 de 15

1

What output will the following statements produce?

n=2
n+=5
print(n)

Selecione uma das seguintes:

  • 7

  • 5

  • 0

  • none

Explicação

Questão 8 de 15

1

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

Selecione uma das seguintes:

  • body

  • expression

  • counter

  • block

Explicação

Questão 9 de 15

1

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

Selecione uma das seguintes:

  • infinite loop

  • universal loop

  • while loop

  • for .. ever loop

Explicação

Questão 10 de 15

1

Functions can only return Boolean expressions.

Selecione uma das opções:

  • VERDADEIRO
  • FALSO

Explicação

Questão 11 de 15

1

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

Selecione uma das opções:

  • VERDADEIRO
  • FALSO

Explicação

Questão 12 de 15

1

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

Selecione uma das opções:

  • VERDADEIRO
  • FALSO

Explicação

Questão 13 de 15

1

Boolean expressions control _____.

Selecione uma das seguintes:

  • recursion

  • conditional execution

  • alternative executive

  • all of the above

Explicação

Questão 14 de 15

1

The modulus operator is the same as the divide operator.

Selecione uma das opções:

  • VERDADEIRO
  • FALSO

Explicação

Questão 15 de 15

1

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

Selecione uma das opções:

  • VERDADEIRO
  • FALSO

Explicação