You use a(n) statement in pseudocode to write a single alternative decision structure.

focusNode

Didn't know it?
click below

Knew it?
click below

You use a(n) statement in pseudocode to write a single alternative decision structure.

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

Introduction to Programming Chapter 04 - Terms

TermDefinition
Decision Structure (function) A decision structure (AKA selection structure) allows a program to perform actions only under certain conditions.
NOT operator Takes a Boolean expressions as its operand and reverses its logical value.
Short-Circuit Evaluation AND: If the expression to the left of the operand is false, right side is not checked. OR: If the expression to the left of the operand is true, right side is not checked.
OR operator Takes two Boolean expressions as operands and creates a compound Boolean expression that is true when either of the subexpressions is true.
&& AND operator
| | OR operator
!. NOT operator
AND operator Takes two Boolean expressions as its operand and creates a compound Boolean expression that is true only when both subexpressions are true.
Case Structure (AKA) Multiple Alternative Decision Structure
Case Structure (function) Allows you to test the value of a variable or an expression and then use that value to determine which statement or set of statements to execute.
Decision Structure (AKA) Selection Structures
conditionally executed performed only when a certain condition is true.
Single Alternative Decision Structure Provides only one alternative path.
You can use Decision Statements alone to create a complete program? T/F False
If Clause The program line that begins with IF
condition Any expression that can be evaluated as either true or false. AKA Boolean Experssion
Boolean Expressions Expressions that can be evaluated as either true or false.
Relational Operator (function) Determines whether a specific relationship exists between two values.
Relational Operators (examples) > < >= <= == !=
Which relationship operators test for more than one relationship? <= >=
== a relational operator that determines whether the operand on its left is equal to the operand on its right.
Why are two == used? To differentiate between the relational operator and the assignment operator.
Control Structure A logical design that controls the order in which a set of statements executes.
Dual Alternative Decision Structures Two possible paths of execution. One path if TRUE, Another path if FALSE.
What statement do you use in pseudocode to express dual alternative decision structure. If - Else
String Comparisons are case sensitive in most programming languages. T/F True
Nested Decision Structures A decision structure can be nested inside another decision structure to test more than one condition.
If - Then - Else - If statement a simpler way logically to write a nested decision structure.
testExpression The first line of a case structure following Select
Multiple Alternative Decision Structure (AKA) Case Structure
Multiple Alternative Decision Structure (function) Allows you to test the value of a variable or an expression and then use that value to determine which statement or set of statements to execute.
Logical Operators (examples) And Or Not
Logical Operators (function) Allow you to create complex Boolean expressions.
Which Logical Operator would you use to determine whether a numeric value is within a specific range or our of a specific range? AND
Boolean Variable Can hold one of two values: true or false
Which variable is commonly used as a flag? Boolean
What are the four types of variables we've learned so far? Integer Real String Boolean


AB
pseudocode A tool that helps programmers plan a program's logic by writing plain English statements
flowchart A tool that helps programmers plan a program's logic by writing program steps in diagram form, as a series of shapes connected by arrows
sequence structure A unit of program logic in which one step follows another unconditionally
decision structure A unit of program logic that involves choosing between alternative courses of action based on some value
if statement Used to make a single-alternative decision
block One or more statements contained within a pair of curly braces
nested if A statement in which one decision structure is contained within another
dual-alternative decisions Has two possible outcomes
if-else statement Performs a dual-alternative decision
AND operator Determines whether two expressions are both true; it is written using two ampersands (&&)
short-circuit evaluation The C# feature in which parts of an AND or OR expression are evaluated only as far as necessary to determine whether the entire expression is true or false
OR operator Determines whether at least one of two conditions is true; it is written using two pipes (||)
Boolean logical AND An operator that determines whether two expressions are both true; it is written using a single ampersand (&) ; unlike the conditional AND operator, it does not use short-circuit evaluation
Boolean logical inclusive OR An operator that determines whether at least one of two conditions is true; it is written using a single pipe (|) ; unlike the conditional OR operator, it does not use short-circuit evaluation
side effect An unintended consequence
switch structure A single variable against a series of exact matches
switch Starts a switch structure
switch expression A condition in a switch statement enclosed in parentheses
case In a switch structure is followed by one of the possible values that might equal the switch expression
case label Identifies a course of action in a switch structure
break Optionally terminates a switch structure at the end of each case
default Used optionally prior to any action that should occur if the test expression in a case structure does not match any case
governing type In a switch statement is established by the switch expression; it can be of type sbyte, byte, short, ushort, int, unit, long, ulong, char, string, or enum
enum An enumeration , a programming defined type that declares a set of constants
conditional operator Used as an abbreviated version of the if-else statement; it requires three expressions separated by a question mark and a colon
ternary An operator that requires three arguments
NOT operator Uses the exclamation point (!); used to negate the result of any Boolean expression
range check A series of if statements that determine whether a value falls within a specified range

What is single alternative selection?

Single alternative selection. - is a selection structure that includes an action only when an expression is true or when it is false; in other words, when action is required for only one outcome of the question.

When a program provides only one alternative path of execution it is called a?

What is a single alternative decision structure? A decision structure that provides a single alternative path of execution. If the condition that is being tested is true, the program takes the alternative path.

What is a multiple alternative decision structure?

A multiple alternative decision structure allows you to test the value of a variable or expression and then use that value to determine which statement or statements to execute. The case or switch structure is a multiple alternative decision structure.

Which structure can execute a set of statements only under certain circumstances?

Decision structure executes a set of statements under certain conditions.