diff --git a/examples/stage0/snippets/Conditionals.java b/examples/stage0/snippets/Conditionals.java index 999af7fd..b5e3b50b 100644 --- a/examples/stage0/snippets/Conditionals.java +++ b/examples/stage0/snippets/Conditionals.java @@ -3,8 +3,8 @@ * * SPDX-License-Identifier: BSD-3-Clause */ -boolean condition_A; -boolean condition_B; +boolean conditionA; +boolean conditionB; boolean condition; class Drivetrain { @@ -33,10 +33,10 @@ void main() { // [/ifExample] // [elseIfSyntax] - if (condition_A) { - // code to run when condition_A is true - } else if (condition_B) { - // code to run when Condition_B is true + if (conditionA) { + // code to run when conditionA is true + } else if (conditionB) { + // code to run when ConditionB is true } // [/elseIfSyntax] diff --git a/public/learning-course/stage0/conditionals/elseif.png b/public/learning-course/stage0/conditionals/elseif.png deleted file mode 100644 index 6e778f46..00000000 Binary files a/public/learning-course/stage0/conditionals/elseif.png and /dev/null differ diff --git a/public/learning-course/stage0/conditionals/elseif.webp b/public/learning-course/stage0/conditionals/elseif.webp new file mode 100644 index 00000000..4bfa4931 Binary files /dev/null and b/public/learning-course/stage0/conditionals/elseif.webp differ diff --git a/src/content/docs/learning-course/stage0/conditionals.mdx b/src/content/docs/learning-course/stage0/conditionals.mdx index 82e22125..7bb1b6ba 100644 --- a/src/content/docs/learning-course/stage0/conditionals.mdx +++ b/src/content/docs/learning-course/stage0/conditionals.mdx @@ -136,14 +136,14 @@ The syntax is similar to an `if` statement but now it has `else if` at the end. Let's break down what this new addition means. `else if` is a keyword that allows the conditional to run a different task if the if statement is false. -If `condition_A` is true then the code inside the `if` block will run. -If `condition_A` if false, then it will go to the `else if` statement. -If `condition_B` is true, the code inside the `else if` block will run. -If `condition_B` if false, then it will exit the statement and none of the code will run. +If `conditionA` is true then the code inside the `if` block will run. +If `conditionA` if false, then it will go to the `else if` statement. +If `conditionB` is true, the code inside the `else if` block will run. +If `conditionB` if false, then it will exit the statement and none of the code will run. This is also described in the flowchart below