Chapter 4. Short Answer

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

1. Explane what is meant by the term conditionally executed

A conditionally executed statement is performed only when a certain condition is true.

6. When determing whether a number is inside a range, which logical operator is it best to use?

The AND operator

2. You need to test a condition and then execute one set of statements if the condition is true. If the condition is false, you need to execute a different set of statements. What structure will you use?

A duel alternative decision structure

7. What is a flag and how does it work?

A flag is a variable that singnal when some condition exists in the program. When the flag variable is set to False, it indicates the condition does not exist. When tha flag variable is set to True, it means the condition does exist.

4. Briefly describe how the AND operator works.

The AND operator connects two Boolean expressions into one compound expression. Both subexpressions must be true for the compound expression to be true.

5. Briefly describe how the OR operator works.

The OR operator connects two Boolean expressions into one compound expression. One or both subexpressions must be true for the compound expression to be true. It is only necessary for one of the expressions to be true, and it does not matter which.

3. If you need to test the value of a variable and use that value to determine which statement or set of statements to execute, which structure would be the most straightforward to use?

The case structure which is a multiple alternative decision structure


संबंधित स्टडी सेट्स

CISM - Information Security Governance, Strategy, Objectives & Metrics

View Set

Chapter 12 - Psychological Disorders

View Set

Chpt. 4: Business Ethics & Corporate Social Responsibility

View Set

Unit 5 (5.11) Ecological Footprints

View Set

Research Methods and Statistics Prepjet Exam #2,3,4,5,7

View Set