CS1101 Week 6

Descripción

AS - Level (CS 1101 Python) Computer Science Test sobre CS1101 Week 6, creado por Troy Bowlin el 18/05/2016.
Troy Bowlin
Test por Troy Bowlin, actualizado hace más de 1 año
Troy Bowlin
Creado por Troy Bowlin hace alrededor de 8 años
329
1

Resumen del Recurso

Pregunta 1

Pregunta
A function that returns an integer value greater than 0 is called a Boolean function.
Respuesta
  • True
  • False

Pregunta 2

Pregunta
Encapsulation is the process of wrapping a piece of code in a function
Respuesta
  • True
  • False

Pregunta 3

Pregunta
Repeated execution of a set of programming statements is called repetitive execution.
Respuesta
  • True
  • False

Pregunta 4

Pregunta
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.
Respuesta
  • structured development
  • incremental development
  • unit testing
  • systems development life cycle

Pregunta 5

Pregunta
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)
Respuesta
  • 13.0
  • 0
  • expression does not evaluate to Boolean true
  • 13

Pregunta 6

Pregunta
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
Respuesta
  • 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

Pregunta 7

Pregunta
What output will the following statements produce? n=2 n+=5 print(n)
Respuesta
  • 7
  • 5
  • 0
  • none

Pregunta 8

Pregunta
The statements inside of a loop are known as the _____ of the loop.
Respuesta
  • body
  • expression
  • counter
  • block

Pregunta 9

Pregunta
A loop where terminating condition is never achieved is called an _____.
Respuesta
  • infinite loop
  • universal loop
  • while loop
  • for .. ever loop

Pregunta 10

Pregunta
Functions can only return Boolean expressions.
Respuesta
  • True
  • False

Pregunta 11

Pregunta
With built in functions, it is generally acceptable to take a "Leap of Faith".
Respuesta
  • True
  • False

Pregunta 12

Pregunta
"Dead Code" is code that performs calculations but never displays the results
Respuesta
  • True
  • False

Pregunta 13

Pregunta
Boolean expressions control _____.
Respuesta
  • recursion
  • conditional execution
  • alternative executive
  • all of the above

Pregunta 14

Pregunta
The modulus operator is the same as the divide operator.
Respuesta
  • True
  • False

Pregunta 15

Pregunta
Chained conditionals are used when there are three or more possibilities.
Respuesta
  • True
  • False
Mostrar resumen completo Ocultar resumen completo

Similar

Computing Hardware - CPU and Memory
ollietablet123
SFDC App Builder 2
Parker Webb-Mitchell
Data Types
Jacob Sedore
Intake7 BIM L1
Stanley Chia
Software Processes
Nurul Aiman Abdu
Design Patterns
Erica Solum
CCNA Answers – CCNA Exam
Abdul Demir
Abstraction
Shannon Anderson-Rush
Spyware
Sam2
HTTPS explained with Carrier Pigeons
Shannon Anderson-Rush
Data Analytics
anelvr