Chapter 2: First You Need to Plan the Party (Problem-Solving Process)

TRUE/FALSE

	1.	The first step that programmers follow when they solve problems is to plan the algorithm.

ANS:	F	PTS:	1	REF:	12

	2.	The final step that programmers follow when they solve problems is to rigorously test the program using the computer.

ANS:	T	PTS:	1	REF:	12

	3.	The two most important components of any problem are the problem’s output and its input.

ANS:	T	PTS:	1	REF:	12

	4.	When analyzing a problem, you always search first for the input, and then for the output.

ANS:	F	PTS:	1	REF:	12

	5.	The input typically is stated as nouns and adjectives in the problem specification.

ANS:	T	PTS:	1	REF:	12

	6.	When determining the output, it helps to think about the information that you would need to solve the problem manually.

ANS:	F	PTS:	1	REF:	12

	7.	Analyzing real-world problems is generally as easy as analyzing the problems found in a textbook.

ANS:	F	PTS:	1	REF:	13

	8.	If you are having trouble analyzing a problem, try reading the problem specification several times, as it is easy to miss information during the first reading.

ANS:	T	PTS:	1	REF:	13

	9.	Most algorithms begin with an instruction that enters the input items into the computer.

ANS:	T	PTS:	1	REF:	14

	10.	Most algorithms end with an instruction to print, display, or store the output items.

ANS:	T	PTS:	1	REF:	14

	11.	Display, print, and store refer to a file on disk, the printer, and the computer screen, respectively.

ANS:	F	PTS:	1	REF:	14

	12.	To avoid confusion, it is important that the algorithm is consistent when referring to the input and output items.

ANS:	T	PTS:	1	REF:	14

	13.	Pseudocode is standardized.

ANS:	F	PTS:	1	REF:	15

	14.	Unlike a flowchart, pseudocode uses standardized symbols to visually depict an algorithm.

ANS:	F	PTS:	1	REF:	15

	15.	You can draw the flowchart symbols by hand; or, you can use the drawing or shapes feature in a word processor.

ANS:	T	PTS:	1	REF:	15

	16.	When planning an algorithm, you need to create both a flowchart and pseudocode.

ANS:	F	PTS:	1	REF:	15

	17.	For simple algorithms, flowcharts work just fine.

ANS:	F	PTS:	1	REF:	15

	18.	Not all algorithms require a processing item.

ANS:	T	PTS:	1	REF:	16

	19.	Desk-checking is also called pencil-tracing, because the programmer uses a pencil and paper to follow each of the algorithm’s instructions.

ANS:	F	PTS:	1	REF:	18

	20.	Before you begin the desk-check, you first choose a set of sample data for the input values, which you then use to manually compute the expected output values.

ANS:	T	PTS:	1	REF:	18

	21.	It is helpful to use a desk-check table when desk-checking an algorithm.

ANS:	T	PTS:	1	REF:	18

	22.	You can only perform a desk-check using an algorithm’s pseudocode.

ANS:	F	PTS:	1	REF:	18

	23.	You should test an algorithm with invalid data because users sometimes make mistakes when entering data.

ANS:	T	PTS:	1	REF:	20

MULTIPLE CHOICE

	1.	The ____ is the goal of solving the problem.
a.	yield	c.	contribution	
b.	output	d.	input	

ANS:	B	PTS:	1	REF:	12

	2.	The ____ is the item or items needed to achieve the goal.
a.	yield	c.	contribution	
b.	output	d.	input	

ANS:	D	PTS:	1	REF:	12

	3.	A helpful way to identify the ____ is to search the problem specification for what the user wants to see printed on paper, displayed on the screen, or stored in a file.
a.	output	c.	yield	
b.	contribution	d.	input	

ANS:	A	PTS:	1	REF:	12

	4.	What the user wants to see printed on paper, displayed on the screen, or stored in a file is typically stated as ____ and adjectives in the problem specification.
a.	adverbs	c.	nouns	
b.	commands	d.	verbs	

ANS:	C	PTS:	1	REF:	12

	5.	If a problem specification indicates that the program’s user wants to see the amount of her annual commission displayed on the screen, the ____ is the annual commission.
a.	yield	c.	symbol	
b.	output	d.	input	

ANS:	B	PTS:	1	REF:	12

	6.	A helpful way to identify the ____ is to search the problem specification for what information the computer will need to know to print, display, or store the output items.
a.	output	c.	yield	
b.	symbols	d.	input	

ANS:	D	PTS:	1	REF:	12

	7.	Suppose that a user wants to see his new weekly pay displayed on the screen. In this context, the words new and weekly are ____.
a.	adjectives	c.	nouns	
b.	verbs	d.	adverbs	

ANS:	A	PTS:	1	REF:	13

	8.	The ____ step is the most difficult of the problem-solving steps, and it requires a lot of time, patience, and effort.
a.	planning	c.	analysis	
b.	desk-check	d.	testing	

ANS:	C	PTS:	1	REF:	13

	9.	The second step in the problem-solving process is to plan the ____, which is the set of instructions that, when followed, will transform the problem’s input into its output.
a.	program	c.	instructions	
b.	algorithm	d.	statements	

ANS:	B	PTS:	1	REF:	14

	10.	____ is called false code because, although it resembles programming language instructions, it cannot be understood by a computer.
a.	Binary code	c.	Planning code	
b.	Empty code	d.	Pseudocode	

ANS:	D	PTS:	1	REF:	15

	11.	Programmers use ____ to help them while they are planning an algorithm.
a.	pseudocode	c.	templates	
b.	sheets	d.	charts	

ANS:	A	PTS:	1	REF:	15

	12.	Programmers use the pseudocode as a guide when coding the algorithm, which is the ____ step in the problem-solving process.
a.	second	c.	fourth	
b.	third	d.	fifth	

ANS:	D	PTS:	1	REF:	15

	13.	Besides using pseudocode, programmers also use ____ when planning algorithms.
a.	pseudocharts	c.	flowcharts	
b.	templates	d.	coding sheets	

ANS:	C	PTS:	1	REF:	15

	14.	Symbols are connected with lines, called ____.
a.	chartlines	c.	leaders	
b.	flowlines	d.	trackers	

ANS:	B	PTS:	1	REF:	15

	15.	The oval symbol in a flowchart is called the ____ symbol.
a.	start/stop	c.	process	
b.	input/output	d.	flow	

ANS:	A	PTS:	1	REF:	15

	16.	The parallelogram symbol in a flowchart is called a(n) ____ symbol.
a.	start/stop	c.	process	
b.	input/output	d.	flow	

ANS:	B	PTS:	1	REF:	15

	17.	The rectangle in a flowchart is called the ____ symbol and is used to represent tasks such as calculations.
a.	start/stop	c.	process	
b.	input/output	d.	flow	

ANS:	C	PTS:	1	REF:	15

	18.	When an algorithm becomes more complex, the program’s logic may be easier to see in ____.
a.	code	c.	pseudocode	
b.	a processor	d.	a flowchart	

ANS:	D	PTS:	1	REF:	15-16

	19.	A ____ item represents an intermediate value that the algorithm uses when processing the input into the output.
a.	calculating	c.	processing	
b.	data	d.	storage	

ANS:	C	PTS:	1	REF:	16

	20.	The term ____ refers to the fact that the programmer reviews the algorithm while seated at his or her desk rather than in front of the computer.
a.	desk-checking	c.	desk-tracing	
b.	program-checking	d.	hand-checking	

ANS:	A	PTS:	1	REF:	18

	21.	You ____ an algorithm to verify that it is not missing any steps, and that the existing steps are correct and in the proper order.
a.	desk-trace	c.	program-check	
b.	desk-check	d.	hand-check	

ANS:	B	PTS:	1	REF:	18

	22.	____ data is data that the algorithm is expecting the user to enter.
a.	Invalid	c.	Unchecked	
b.	Checked	d.	Valid	

ANS:	D	PTS:	1	REF:	20

	23.	____ data is data that the algorithm is not expecting the user to enter.
a.	Invalid	c.	Unchecked	
b.	Checked	d.	Valid	

ANS:	A	PTS:	1	REF:	20