if Statements
The if statement is used to create a decision structure, which allows a program to have more
than one path of execution. The if statement causes one or more statements to execute only
when a Boolean expression is true.
A control structure is a logical design that controls the order in which a set of statements
execute. sequence structure (a set of statements that execute in the order in which they
appear.)
Although the sequence structure is heavily used in programming, it cannot handle every type of
task. This is because some problems simply cannot be solved by performing a set of ordered
steps, one after the other. Programs like this require a different type of control structure: one
that can execute a set of statements only under certain circumstances. This can be
accomplished with a decision structure. (Decision structures are also known as selection
structures.)
The action is conditionally executed because it is performed only when a certain condition is
true.
single alternative decision structure: provides only one alternative path of execution.
In Python, we use the if statement to write a single alternative decision structure.
General format:
1 Structure can execute a set of statements only under certain circumstancesDecision2 A __________ structure provides one alternative path of execution.
Get answer to your question and much more
3 In pseudocode the if then statement is an example of decision structure
Get answer to your question and much more
4. A(n) __________ expression has a value of either true or false.
Get answer to your question and much more
5. The symbols >,<, and == are all__________ operators.
Get answer to your question and much more
6. A(n) __________ structure tests a condition and then takes one path if the condition is true, oranother path if the condition is false.
Get answer to your question and much more
7. You use a(n) __________ statement in pseudocode to write a single alternative decision structure.
Get answer to your question and much more
8. You use a(n) __________ statement in pseudocode to write a dual alternative decision structure.
Get answer to your question and much more
9. A __________ structure allows you to test the value of a variable or an expression and then use thatvalue to determine which statement or set of statements to execute.
Get answer to your question and much more
10. A(n) __________ section of a Select Case statement is branched to if none of the case values matchthe expression listed after the Select statement.
Get answer to your question and much more
11. AND, OR, and NOT are __________ operators.
Get answer to your question and much more
12. A compound Boolean expression created with the __________ operator is true only if both of itssubexpressions are true.
Get answer to your question and much more