Name: Mukesh Kalikaya
Date: 27-January-2023
I received assistance from: No one
I assisted: No one
The repeat-while loop executes the statements within the body of the loop which is something a while doesn't do. Instead, the condition, the Boolean test, is evaluated in a while loop. Both of them do test two conditionals and create a loop according to those conditionals.
The minimum number that this loop will be executed is 1.
The purpose of the Jump instruction is so that the loop can go back to the beginning of the loop.
Both while loop and repeat-while loop will execute the same number of times. In the below example, if the initial value of variable x=3 (meaning the condition is false), then while loop will give different result. But if the first value of x is 6, both executions will give same result.
Based on the results, you can see that the repeat-while loop doesn't function the same way that a while loop does because it prints a statement first instead of running the condition first.
In the above example for question 1 in section 2, the while loop will not print a statement before checking the condition. Only if the initial value of a variable used in the condition is true. In this case both repeat-while loop and while loop execute the block of code the same number of times.
I learned about the functionality of repeat-while loops and the statements/format to run them.
I didn't encounter any challenges because repeat-while loops are pretty similar to while loops which I was confidently able to do in the previous unit.
This experience is at it's best.
Now that I know what repeat-while loops are used for and how to use them, I can use this type of loop if I want to repeatedly execute a program and if that is interrupted, I can go to the next condition that I can mention to do something else.