Iteration — Unit test Answers

7 verified answers1 views
1
Free Preview

An argument is different from a parameter in that an argument

A
refers to a piece of data to be supplied.
B
is a placeholder for a constant value.
C
is the data passed into a parameter.
D
is always variable.
2
Free Preview

Use the conversion table below to help you answer the question.Which choice represents a correct conversion of the hexadecimal value “CAB”?

Question illustration
A
the decimal string 12 10 11
B
the octal string 14 13 12
C
the binary string 1100 1101 1110
D
the octal string 12 13 14
3

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.
4

Mark and John are developing a program using Python. They name a variable 24_hour_mart, but then recognize that this name violates a Python naming convention. What naming convention does it violate?

A
Variable names can not include the underscore character (_).
B
Variable names can not begin with a number.
C
Variable names can not exceed ten characters in length.
D
Variable names can not be fewer than fifteen characters in length.
5

Two programmers wrote very similar code. Compare the two to decide what the difference will be between them.Programmer A Programmer Bdef drawUnknown(): x = 20 pendown() forward(x) penup()def drawUnknown(): x = 50 pendown() forward(x) penup()

A
Programmer A draws a shorter line than Programmer B.
B
Programmer A draws a circle, while Programmer B draws a square.
C
Programmer A draws a longer line than Programmer B.
D
Programmer A draws an H, while Programmer B draws an E.
6

Which is a real-world example of a procedure?

A
calculating the tip given the total at a restaurant
B
pressing submit and getting a new password
C
dividing to determine the number of cookies to distribute to each guest
D
getting up and dressing before school
7

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
8

Kali, a Python programmer, is using the turtle module to write the word “hello.” Which code should she use to indicate the location to begin writing the word?

A
# Pick up the turtle and move it to its starting location.
B
penup(-100, 200) goto()pendown()
C
penup() goto(-100, 200) pendown()
D
# Pick up the turtle and move it to (-100, 200)
9

What part of the code is a signal for the function to execute and pass back a value?

A
the parameter
B
the return statement
C
the keyword argument
D
the exit line
10

How is an interpreter different from a compiler?

A
An interpreter translates and executes code line by line, while a compiler translates all code at once so that it is ready to be executed at any time.
B
An interpreter translates all code at once so that it is ready to be executed at any time, while a compiler translates and executes code line by line.
C
An interpreter translates programming code into binary language, while a compiler does not.
D
An interpreter translates binary language into programming language, while a compiler translates programming language into binary language.
11

Binary is best interpreted by a computer because

A
it is a simple system using patterns of three numbers.
B
the numbers in the system represent the on and off positions of the switches in a computer’s hardware.
C
it is broken down into bits.
D
it can be easily converted to the decimal system.
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

What does it mean to “declare a variable”?

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

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
16

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
17

Use the conversion table below to help you answer the question. What is the decimal value of the binary number 1011?

Question illustration
A
0.1011
B
0.1100
C
11
D
13
18

Terrell, a programmer, is creating a website for an online merchant and wants the program to calculate the total price based on the quantity of items ordered and the tax on the total. In order to avoid specifying the procedure in every new situation, he can create and use a

A
code.
B
function.
C
global variable.
D
subroutine.
19

Which string of octal values in the conversion table can be used to represent the word “BAKE”?

Question illustration
A
101 102 105 107
B
105 113 101 102
C
102 101 113 105
D
1018 1028 1058 1078

Did you find these answers helpful?