CS1101 Week 6

Beschreibung

AS - Level Computer Science (CS 1101 Python) Quiz am CS1101 Week 6, erstellt von Troy Bowlin am 18/05/2016.
Troy Bowlin
Quiz von Troy Bowlin, aktualisiert more than 1 year ago
Troy Bowlin
Erstellt von Troy Bowlin vor etwa 8 Jahre
328
1

Zusammenfassung der Ressource

Frage 1

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

Frage 2

Frage
Encapsulation is the process of wrapping a piece of code in a function
Antworten
  • True
  • False

Frage 3

Frage
Repeated execution of a set of programming statements is called repetitive execution.
Antworten
  • True
  • False

Frage 4

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

Frage 5

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

Frage 6

Frage
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
Antworten
  • 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

Frage 7

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

Frage 8

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

Frage 9

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

Frage 10

Frage
Functions can only return Boolean expressions.
Antworten
  • True
  • False

Frage 11

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

Frage 12

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

Frage 13

Frage
Boolean expressions control _____.
Antworten
  • recursion
  • conditional execution
  • alternative executive
  • all of the above

Frage 14

Frage
The modulus operator is the same as the divide operator.
Antworten
  • True
  • False

Frage 15

Frage
Chained conditionals are used when there are three or more possibilities.
Antworten
  • True
  • False
Zusammenfassung anzeigen Zusammenfassung ausblenden

ähnlicher Inhalt

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