AnswersFL-8207310-Digital Information Technology BFunctions, Procedures, Arguments and Parameters

Functions, Procedures, Arguments and Parameters — Unit test Answers

5 verified answers
1
Free Preview

Which is an example of a Boolean operator that evaluates as TRUE?

A
3 +1 = 4 AND 5 + 2 = 8
B
NOT (3 +2 =7)
C
2 + 4 = 5 OR 6 + 2 = 7
D
4 + 1 = 7 AND 10 + 2 = 12
2
Free Preview

Which statement demonstrates the value of an iteration in programming?

A
An iteration can be used instead of many repetitive lines of code in a computer program.
B
An iteration makes a program end without having to press keys on the keyboard.
C
An iteration formats the code in a program into a neat indented form.
D
An iteration controls the order in which a program executes code.
3

Which is an example of a function header in Python?

A
left (40):
B
def drawT():
C
left
D
def
4

What is one difference between IDLE and Eclipse?

A
IDLE is a multi-language IDE, while Eclipse is a language-specific IDE.
B
IDLE is a language-specific IDE, while Eclipse is a multi-language IDE.
C
IDLE is proprietary software, while Eclipse is open-source software.
D
IDLE is open-source software, while Eclipse is proprietary software.
5

The data that a function takes in is called

A
a return value.
B
syntax.
C
an argument.
D
output.
6

Dinah is using an IDE to write, modify, and save code. Which tool should she use?

A
a source code editor
B
a build automation tool
C
a compiler
D
a debugger
7

What kind of data type would a Python programmer assign a variable to indicate a fractional number?

A
int
B
str
C
float
D
list
8

A Python programmer is writing a function definition. What syntax should be used?

A
def( statement ): functionName argument1 argument2 argument3
B
def functionName( arguments ): statement1 statement2 statement3
C
def functionName( statement ): argument1 argument2 argument3
D
def( arguments ): functionName statement1 statement2 statement3
9

In Python, if var1 = “Happy” and var2= “Birthday” and var3 = (var1+var2) *2, then var3 stores the string

A
“HappyBirthdayHappyBirthday”.
B
“HappyHappyBirthday”.
C
“HappyBirthdayHappyBirthdayHappyBirthday”.
D
“HappyBirthdayBirthday”.
10

Mika forgot to put in the function name in his function header for the code below. What would be the best function header?def draw(): forward(80) left(120) forward(80) left(120) forward(80) left(120)

A
def drawDiamond():
B
def drawTriangle():
C
def drawN():
D
def drawH():
11

What is an Integrated Development Environment (IDE)?

A
a coordinated software development effort
B
a coordinated software program writing package
C
a diverse workplace for software developers
D
a diverse workplace for all employees in a software development company
12

What is a compiler?

A
a tool used to integrate multiple software programs
B
a tool used to extract a single software program from an integrated collection of programs
C
a computer software application that translates binary computer machine language into a computer programming language
D
a computer software application that translates a computer programming language into a binary computer machine language
13

In Python programming language, what is a function statement?

A
an action that a function will execute
B
an action that is defined in a function header
C
the first line of a function definition
D
the first comment in a software program
14

Achieving intended results ends

A
the testing cycle.
B
the compiling process.
C
the stepping function.
D
the writing of program code.
15

Which is a correctly formatted Python tuple?

A
[12, “circle”, “square”]
B
{“n”:12, “shape1”: “circle”, “shape2”: “square”}
C
(12, “circle”, “square”)
D
12 circle square
16

What does it mean to “declare a variable”?

A
create a variable
B
use a variable
C
share a variable
D
modify a variable
17

A sequence index uses a built-in function called length or len() to provide a total number of elements in an ordered list. With which iteration does this function work?

A
a for loop
B
a while loop
C
an infinite loop
D
a single statement loop
18

Variables differ from values in that

A
variables are always letters of the alphabet and values are always numbers.
B
a variable is a symbol or a placeholder while a value is assigned to a variable as the result of a function.
C
a variable is accessible from anywhere in a program while a value is accessible only in one situation.
D
a variable is defined by the programmer while a value is defined by the program.
19

A looping construct that continues to repeat until the expression becomes false is

A
a while loop.
B
a for loop.
C
an infinite loop.
D
a pass loop.

Did you find these answers helpful?