Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/bhoffman0/CSAwesome
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Nov 17, 2024
2 parents 188908e + 1ce6f4c commit e542744
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion _sources/Unit4-Iteration/topic-4-1-while-loops.rst
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ You can use a ``while`` loop to repeat the body of the loop a certain number of

<a href="https://replit.com/@BerylHoffman/Average#Main.java" target="_blank">replit</a>

Here's another example of an input-conrolled loop, which you can try online with |JuiceMind| or |replit|. This code calculates the average of positive numbers. The number -1 is used as the **sentinel value**. The while loop will run while the user does not input -1. What would happen if you forgot step 3 (change the loop variable - get a new input)? Remember that skipping step 3 will often lead to an infinite loop!
Here's another example of an input-controlled loop, which you can try online with |JuiceMind| or |replit|. This code calculates the average of positive numbers. The number -1 is used as the **sentinel value**. The while loop will run while the user does not input -1. What would happen if you forgot step 3 (change the loop variable - get a new input)? Remember that skipping step 3 will often lead to an infinite loop!

.. code-block:: java
Expand Down

0 comments on commit e542744

Please sign in to comment.