# CS1101 Week 6

Quiz by Troy Bowlin, updated more than 1 year ago
12
1
0

### Description

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

## Resource summary

### Question 1

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

### Question 2

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

### Question 3

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

### Question 4

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

### Question 5

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

### Question 6

Question
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
• 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

### Question 7

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

### Question 8

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

### Question 9

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

### Question 10

Question
Functions can only return Boolean expressions.
• True
• False

### Question 11

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

### Question 12

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

### Question 13

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

### Question 14

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

### Question 15

Question
Chained conditionals are used when there are three or more possibilities.
• True
• False

### Similar

Computing Hardware - CPU and Memory
SFDC App Builder 2
Intake7 BIM L1
Data Types