Skip to content

Commit 173ce32

Browse files
committed
Updating content of if statements approach
1 parent c3dcc96 commit 173ce32

File tree

1 file changed

+11
-11
lines changed
  • exercises/practice/bob/.approaches/if-statements

1 file changed

+11
-11
lines changed

exercises/practice/bob/.approaches/if-statements/content.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,23 @@ This approach simplifies the main method `hey` by breaking down each response co
4545

4646
The `input` is trimmed using the `String` [`trim()`][trim] method to remove any leading or trailing whitespace. This helps to accurately detect if the input is empty and should prompt a `"Fine. Be that way!"` response.
4747

48-
### **Delegating to Helper Methods**:
49-
48+
### Delegating to Helper Methods
49+
5050
Each condition is evaluated using the following helper methods:
5151

52-
- **`isSilent`**: Checks if the trimmed input has no characters.
53-
- **`isShouting`**: Checks if the input is all uppercase and contains at least one alphabetic character, indicating shouting.
54-
- **`isQuestioning`**: Verifies if the trimmed input ends with a question mark.
52+
1. **`isSilent`**: Checks if the trimmed input has no characters.
53+
2. **`isShouting`**: Checks if the input is all uppercase and contains at least one alphabetic character, indicating shouting.
54+
3. **`isQuestioning`**: Verifies if the trimmed input ends with a question mark.
5555

5656
This modular approach keeps each condition encapsulated, enhancing code clarity.
5757

58-
### **Order of Checks**:
59-
58+
### Order of Checks
59+
6060
The order of checks within `hey` is important:
61-
- Silence is evaluated first, as it requires an immediate response.
62-
- Shouted questions take precedence over individual checks for yelling and asking.
63-
- Yelling comes next, requiring its response if not combined with a question.
64-
- Asking (a non-shouted question) is checked afterward.
61+
1. Silence is evaluated first, as it requires an immediate response.
62+
2. Shouted questions take precedence over individual checks for shouting and questioning.
63+
3. Shouting comes next, requiring its response if not combined with a question.
64+
4. Questioning (a non-shouted question) is checked afterward.
6565

6666
This ordering ensures that Bob’s response matches the expected behavior without redundancy.
6767

0 commit comments

Comments
 (0)