Save
or

or

taken

Make sure to remember your password. If you forget it there is no way for StudyStack to send you a reset link. You would need to create a new account.

Enter the associated with your account, and we'll email you a link to reset your password.
focusNode
Didn't know it?
click below

Knew it?
click below
Don't Know
Remaining cards (0)
Know
0:00
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.

Normal Size     Small Size show me how

# Chapter 5

### Making Decisions

TermDefinition
Pseudocode A tool that helps programmers plan a program's logic by writing plain English statements
Flowchart Is similar to pseudocode, but the steps are written in diagram form as a series of shapes connected by arrows
Sequence Structure A logical structure in which one step follows another unconditionally
Decision Structure A structure that involves choosing between alternative courses of action based on some value within a program
if Statement The simplest statement you can use to make a decision. Ex: if(quizScore == 10)... System.out.println("The score is perfect");
Equivalency Operator The double equal sign (==) is used to determined equality
Single-Alternative if When the program only performs an action, or not, based on one alternative
Dual-Alternative if The decision structure you use when you need to take one or or the other of two possible courses of action
if...else Statement Provides the mechanism to perform one action when a Boolean expression evaluates to true and to perform a different action when a Boolean expression evaluates as false
Nested if Statements Statements in which an if structure is contained inside another if structure. Are particularly useful when two conditions must be met before some action it taken
Logical AND Operator For an alternative to some nested if statement, you can use the logical AND operator between two Boolean expressions to determine whether both are true. In Java, the AND operator is written as two ampersands(&&)
Logical OR Operator When you want some action to occur even if only one of two conditions is true, you can use nested if statements, or you can use the logical OR operator, which is written as ||.
Short-Circuit Evaluation The expression on each side of the && and the || operators are evaluated only as far as necessary to determine whether the entire expression is true or false.
Range Check A series of statements that determine to which of several consecutive series of values another value falls
1. switch Statement Is useful when you need to test a single variable against a series of exact integer(including int, byte, and short types), character, or string values. The switch statement uses four keywords...
2. switch Statement 1. "switch" starts the structure and is followed immediately by a test expression enclosed in parentheses.. 2. "case" is followed by one of the possible values for the test expression and a colon..
3. switch Statement 3. "break" optionally terminates a switch statement at the end of each case.. 4. "default" optionally is used prior to any action that should occur if the test variable does not match any case.
4. switch Statement switch(year).. {.. case 1:.. System.out.println("Freshman");.. break;.. case 2:.. System.out.println("Sophomore");.. break;.. case 3:. System.out.println("Junior");.. break;.. default:.. System.out.println("Invalid year");.. }
1. Conditional Operator Requires three expressions separated with a question mark and a colon and is used as an abbreviated version of the if...else structure. The syntax is:.. testExpression? trueResult : falseResult;...
2. Conditional Operator The first expression, testExpression, is a Boolean expression that is evaluated as true or false. If its is true, the entire conditional expression takes on the value of the expression following the question mark(trueResult).
3. Conditional Operator If the value of the testExpression is false, the entire expression takes on the vale of falseResult. Ex: smallerNum = (a < b) ? a : b;
Ternary Operator An operator that needs three operands. A conditional operator is ternary
NOT Operator Written as the exclamation point(!), and used to negate the result of any Boolean expression
Operators with Highest Precedence Operator[Logical NOT]..Symbol[!]
1. Operators with Intermediate Precedence 1. Operators[Multiplication, division, modulus]..Symbols[*, /, %]... 2. Operators[Addition, Subtraction]..Symbols[+, -]... 3. Operators[Relational]..Symbols[>, <, >=, <=]... 4. Operators[Equality]..Symbols[==, !=]...
2. Operators with Intermediate Precedence 5. Operators[Logical AND]..Symbols[&&]... 6. Operators[Logical OR]..Symbols[||]... 7. Operators[Conditional]..Symbols[?:]
Operators with Lowest Precedence Operator[Assignment]..Symbol[=]

Voices

Use these flashcards to help memorize information. Look at the large card and try to recall what is on the other side. Then click the card to flip it. If you knew the answer, click the green Know box. Otherwise, click the red Don't know box.

When you've placed seven or more cards in the Don't know box, click "retry" to try those cards again.

If you've accidentally put the card in the wrong box, just click on the card to take it out of the box.

You can also use your keyboard to move the cards as follows:

• SPACEBAR - flip the current card
• LEFT ARROW - move card to the Don't know pile
• RIGHT ARROW - move card to Know pile
• BACKSPACE - undo the previous action

If you are logged in to your account, this website will remember which cards you know and don't know so that they are in the same box the next time you log in.

When you need a break, try one of the other activities listed below the flashcards like Matching, Snowman, or Hungry Bug. Although it may feel like you're playing a game, your brain is still making more connections with the information to help you out.

To see how well you know the information, try the Quiz or Test activity.

Pass complete!
 "Know" box contains: Time elapsed: Retries:
restart all cards