Concept explainers
A __________ structure executes a set of statements only under certain circumstances.
- a. sequence
- b. circumstantial
- c. decision
- d. Boolean
The structure which executes statements under certain conditions is called as a decision structure.
Hence, the correct answer is option “C”.
Explanation of Solution
Decision structure:
- Decision structure executes a set of statements under certain conditions.
- It is also known as selection structure.
- The action is performed only when the condition exists and takes different action depending upon the state “True” or “False”.
Example for decision structure:
“if” statement:
“if” statement is used to make a decision structure, which permits the program to hold more than one path of execution.
- The indented statement is executed only when the condition is “true”.
- If the given condition is “false”, it skips the indented statements.
Syntax for “if” statement:
if condition:
indented_statement_block
Explanation for incorrect options:
Sequence:
Simplest form of control structure is the sequence structure. It is a group of statements that are executed in the order in which they appear.
Hence, the option “A” is wrong.
Circumstantial:
Circumstantial structure does not execute the statements under certain conditions.
Hence, the option “B” is wrong.
Boolean:
The Boolean expression evaluates the statement as either “True” or “False” with the help of “if” statement.
Hence, the option “D” is wrong.
Want to see more full solutions like this?
Chapter 4 Solutions
Starting Out With Visual C# (5th Edition)
Additional Engineering Textbook Solutions
Modern Database Management
Web Development and Design Foundations with HTML5 (8th Edition)
Concepts of Programming Languages (11th Edition)
Database Concepts (7th Edition)
Computer Science: An Overview (12th Edition)
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)