Back
CS-I ISP Journal Blog
J1002: Shell J1006: Source Control J1008: Merlin Mission Manager J1012: Alternative Base Addition J1013: Boolean Algebra J1016: Logic Composition J1017: Binary Adders J1151: Conditional and Flow Chart J1152: While Loops J1292: Useful Randomness

CS-I Journal J1152: While Loops

Author: Tiffany Jiang

Date: 24-Jan-2023

I received assistance from: NO ONE

I assisted: NO ONE

 

Section 1

1.1: What is the test executed prior to the loop?

Is the number less than or equal to four? Four is subtracted from the initial number.

1.2: Compare this diagram to that of the conditional. What are similarities? What are differences?

Both loops test for a boolean value, but the while loop can re-occur by itself any amount of times. A conditional will only occur by itself once.

1.3: What is the purpose of the Jump instruction after the consequent?

It resets the loop to before the boolean question is asked.

 

What did I learn? What is the "big idea"?

While loops can re-occur any amount of times as long as a boolean value remains true, but will eventually have to end. I also learned more about analyzing machine code.

What challenges did I encounter?

I initially had troubles describing the differences between a conditional and a while loop.

"How could this experience be improved?

I found the explanations very clear.