Moment 1 Flashcards
Chapter 3.1 - 3.5 Chapter 2.5.4 , 2.5.6, 2.6 and 2.7
What is the procedure for solving a problem?
- the actions to execute and
- the order in which these actions execute
is called an algorithm.
What is an important component when writing an algorithm?
The order in which the actions executed.
Specifying the order in which statements (actions) execute in a program is called?
program control
What is Pseudocode?
Pseudocode is an informal language that helps you develop algorithms without having to worry about the strict details of Java language syntax.
What dose Pseudocode help with?
Pseudocode does not execute on computers. Rather, it helps you “think out” a program before attempting to write it in a programming language, such as Java.
What is sequential execution?
Normally, statements in a program are executed one after the other in the order in which they’re written. 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’s work demonstrated that all programs could be written in terms of only three control structures—Which?
the sequence structure
the selection structure
the iteration structure.
Reefed to as, in the terminology of the Java Language Specification, “control statements.”
What are Activity diagrams?
Activity diagrams are composed of symbols, such as action-state symbols (rectangles with their left and right sides replaced with outward arcs), diamonds and small circles. These symbols are connected by transition arrows, which represent the flow of the activity—that is, the order in which the actions should occur.
What dose activity diagrams help with?
Like pseudocode, activity diagrams help you develop and represent algorithms. Activity diagrams clearly show how control structures operate.
activity diagram:
The solid circle at the top of the activity diagram represents?
the initial state—the beginning of the workflow before the program performs the modeled actions.
See fig 3.1 on page 123 in book
activity diagram:
The solid circle surrounded by a hollow circle at the bottom of the diagram represents?
the final state—the end of the workflow after the program performs its actions.
See fig 3.1 on page 123 in book
activity diagram:
The arrows represents?
The arrows represent transitions, which indicate the order in which the actions represented by the action states occur.
See fig 3.1 on page 123 in book
activity diagram:
Figure 3.1 also includes rectangles with the upper-right corners folded over. These are?
UML notes (like comments in Java)—explanatory remarks that describe the purpose of symbols in the diagram.
See fig 3.1 on page 123 in book
What are Javas three types of selection statements?
if statement
if…else statement
switch statement
What dose the “if” statement do?
The if statement either performs (selects) an action, if a condition is true, or skips it, if the condition is false.
The if statement is a single-selection statement because it selects or ignores a single action (or, as we’ll soon see, a single group of actions).
What dose the “if…else” statement do?
The if…else statement performs an action if a condition is true and performs a different action if the condition is false.
The if…else statement is called a double-selection statement because it selects between two different actions (or groups of
actions).
What dose the “switch” statement do?
The switch statement performs one of many different actions, depending on the value of an expression.
The switch statement is called a multiple-selection statement because it selects among many different actions (or groups of actions).