Readable Code — Unit test Answers

0 verified answers1 views
1
Free Preview

Character encoding uses bit patterns, sequences of numbers, or electrical pulses to

A
recover errors in software programming.
B
represent characters in a given set.
C
correct grammatical and spelling errors.
D
define the placement of graphics on a website.
2
Free Preview

A computer program checks to see if the user of a software program has clicked on a photo. This is an example of a requirement that can be evaluated in

A
a string statement.
B
a goto statement.
C
a global statement.
D
a conditional statement.
3

Which is true of ASCII and Unicode?

A
Every character written in Unicode can be represented in ASCII.
B
Every character written in ASCII can be represented using Unicode.
C
ASCII requires more bytes than Unicode.
D
ASCII and Unicode both define accented characters.
4

What is a feature of readable code?

A
The code is interesting to read.
B
The code uses meaningful names for variables, procedures, and classes.
C
The code is all aligned to the left margin.
D
The code is as compact as possible to save space.
5

Kerry is debugging a program. She identifies a line of code to begin execution and a line of code to end execution so that she is only running part of the computer program. Which is she using?

A
variable inspections
B
breakpoints
C
stepping functions
D
line-by-line search
6

The process of identifying and eliminating bugs in a software program is most generally called

A
reproducing the problem.
B
diagnosing.
C
debugging.
D
troubleshooting.
7

Which statement allows more than one condition in an If statement?

A
Else
B
While
C
Elif
D
If-then
8

What does a computer program use as a means to evaluate a condition as True or False?

A
a Boolean expression
B
a Boolean string
C
a Boolean variable
D
a Boolean operator
9

Which function works best when you need to remove an element at a specific index in a list?

A
the len() function
B
the range() function
C
the pop() function
D
the deque() function
10

The best description for a group of elements in an array is

A
a data structure.
B
a queue.
C
a string.
D
a stack.
11

Which line of code will eliminate the element “calculator” from an array of supplies?

A
supplies.append(“calculator”)
B
supplies.pop(“calculator”)
C
supplies.delete(“calculator”)
D
supplies.remove(“calculator”)
12

One reason it is important to write code that is readable is that

A
it makes the code execute faster, which makes the code run better.
B
it saves space on the page for important comments.
C
it makes it easier to copy when you want to send the code to others.
D
it makes it easier to follow when revisions or updates are called for.
13

What can be written to perform a certain number of iterations or to iterate until a specific result is achieved?

A
an ordered data structure
B
a for loop
C
a print function
D
an array
14

A program runs from start to finish, producing unexpected results, though no error message is received. What most likely occurred?

A
a run-time error
B
a logic error
C
a syntax error
D
a message error
15

A misplacement of punctuation or spacing in a command during programming that causes the program to stop running is most likely which type of error?

A
syntax
B
run-time
C
logic
D
compiler

Did you find these answers helpful?

Readable Code — Unit test Answers…