[go: up one dir, main page]

0% found this document useful (0 votes)
230 views9 pages

Chapter 2 Answer Key

The document contains multiple choice questions about computer programming concepts. These include questions about variable data types, operators, functions, errors, pseudocode, and more. Correct answer choices are provided for each question to test understanding of key programming topics.

Uploaded by

apap.004589
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
230 views9 pages

Chapter 2 Answer Key

The document contains multiple choice questions about computer programming concepts. These include questions about variable data types, operators, functions, errors, pseudocode, and more. Correct answer choices are provided for each question to test understanding of key programming topics.

Uploaded by

apap.004589
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

1.

A __________ error does not prevent the program from


running, but causes it to produce incorrect results.

a. syntax

b. hardware

c. logic

d. fatal

2. A __________ is a single function that the program must


perform in order to satisfy the customer.

a. task

b.prerequisite

b. software requirement

c.predicate

3. A(n) __________ is a set of well-defined logical steps that


must be taken to perform a task.

a. plan of action

b. logic schedule

c. algorithm
4. An informal language that has no syntax rules and is not
meant to be compiled or executed is called __________.

a. faux code

b. pseudocode

c. Python

d. a flowchart

5. A __________ is a diagram that graphically depicts the


steps that take place in a program.

a. flowchart

b. step chart

c. code graph

d. program graph

6. A __________ is a sequence of characters.

a. char sequence

b. character collection

c. string

d. text block
7. A __________ is a name that references a value in the
computer’s memory.

a. variable

b. register

c. RAM slot

d. byte

8. A __________ is any hypothetical person using a program


and providing input for it.

a. designer

b. user

c. guinea pig

d. test subject

9. A string literal in Python must be enclosed in __________.

a. parentheses.

b. single-quotes.

c. double-quotes.

d. either single-quotes or double-quotes.


10. Short notes placed in different parts of a program
explaining how those parts of the program work are called
__________.

a. comments

b. reference manuals

c. tutorials

d. external documentation

11. A(n) __________ makes a variable reference a value in


the computer’s memory.

a. variable declaration

b. math expression

c. string literal

12. This symbol marks the beginning of a comment in


Python.

a. &

b. *

c. **

d. #
13. Which of the following statements will cause an error?

a. x = 17

b. 17 = x

c. x = 99999

d. x = '17'

14. In the expression 12 + 7, the values on the right and left


of the + symbol are called __________.

a. operands

b. operators

c. arguments

d. math expressions

15. This operator performs integer division.

a. //

b. %

c. **

d. /
16. This is an operator that raises a number to a power. a.

b. *

c. **

d. /

17. This operator performs division, but instead of returning


the quotient it returns the remainder.

a. %

b. *

c. **

d. /

18. Suppose the following statement is in a program: price =


99.0. After this statement executes, the price variable will
reference a value of which data type?

a. int

b. float

c. currency

d. str
19. Which built-in function can be used to read input that
has been typed on the keyboard?

a. input()

b. get_input()

c. read_input()

d. keyboard()

20. Which built-in function can be used to convert an int


value to a float?

a. int_to_float()

b. float()

c. convert()

d. int()

21. A magic number is ________________.

a. a number that is mathematically undefined

b. an unexplained value that appears in a program’s code


c. a number that cannot be divided by 1

d. a number that causes computers to crash


22. A __________ is a name that represents a value that does
not change during the program’s execution.

a. named literal

b. named constant

c. variable signature

d. key term

1. Programmers must be careful not to make syntax


errors when writing pseudocode programs.
True/False

2. In a math expression, multiplication and division take


place before addition and subtraction. True/False

3. Variable names can have spaces in them. True/False

4. In Python, the first character of a variable name


cannot be a number. True/False
5. If you print a variable that has not been assigned a
value, the number 0 will be displayed. True/False

You might also like