Moment 3 Flashcards
Kap 3 & 4 (139 cards)
A procedure for solving a problem in terms of the actions to execute and the order in which they execute is called an?
algorithm
Specifying the order in which statements execute in a program is called?
program control
Pseudocode is an informal language that helps you with?
develop algorithms without having to worry about the strict details of Java language syntax.
Normally, statements in a program are executed one after the other in the order in which they’rewritten. This process is called?
sequential execution
What is transfer of control?
Various Java statements enable you to specify that the next statement to execute is not necessarily the next one in sequence. This is called transfer of control.
Bohm and Jacopini demonstrated that all programs could be written in terms of only three control structures - Which
the sequence structure, the selection structure and the iteration structure.
How does the computer execute Java statements?
Unless directed otherwise, the computer executes Java statements one after the other in the order in which they’re written—that is, in sequence.
What is a activity diagram?
An activity diagram models the workflow of a portion of a software system.
(p. 123; also called the activity)
Activity diagrams are composed of?
symbols — such as action-state symbols, diamonds and small circles—that are connected by transition arrows, which represent the flow of the activity.
(p. 123)
The arrows in an activity diagram represent?
transitions, which indicate the order in which the actions represented by the action states occur.
The solid circle located at the top of an activity diagram represents?
the activity’s initial state —the beginning of the workflow before the program performs the modeled actions.
(p. 123)
The solid circle surrounded by a hollow circle that appears at the bottom of the diagram represents?
the final state —the end of the workflow after the program performs its actions.
(p. 123)
Rectangles with their upper-right corners folded over are UML notes?
explanatory remarks that describe the purpose of symbols in the diagram.
Java has three types of selection statements, which?
if
if…else
switch
What does the if single-selection statement do?
The if single-selection statement selects or ignores one or more actions.
(p. 124)
What does the if…else double-selection statement do?
The if…else double-selection statement selects between two actions or groups of actions.
What does the switch selection statement do?
The switch selection statement selects among many different actions or groups of actions.
(p. 124)
Java provides the while, do…while, for and enhanced for iteration statements that enable programs to?
perform statements repeatedly as long as a loop-continuation condition remains true.
What does the “while”, “do…while” and “for” statements do?
The “while” and “for” statements perform the action(s) in their bodies zero or more times, based on their loop-continuation conditions (p. 124). The “do…while” statement its body one or more times.
What is control-statement stacking?
Single-entry/single-exit control statements are attached to one another by connecting the exit point of one to the entry point of the next. This is known as control-statement stacking.
(p. 124)
The if statement is a?
single-entry/single-exit control statement.
What action dose the “if…else” double-selection statement perform?
The “if…else” double-selection statement performs one action (or group of actions) when the condition is true and another action (or group of actions) when the condition is false.
How can a program test multiple cases?
A program can test multiple cases with nested if…else statements (p. 127).
What is the “Dangling-“else” Problem”
The Java compiler associates an else with the immediately preceding if unless told to do otherwise by the placement of braces.