The main difference between an “if” test and a “while ”
While Loops
Happens many times (as long as the test is true)

If test
Happens 1 time
Two Friends Meet


In the prior assignment (#2b), you were asked to go around the inner lake as shown below. We are going to add 1 new requirement to this
What is new this time?
recangular-lake.jev

recangular-lake-if2.jev
Scroll down for a hint about how to handle if test #1 for this map.
A closerlook at if test #1 (how to get around that first if test)
rectangular-lake-bumps1.jev

recangular-lake-bump3A.jev
recangular-lake-bump3B.jev ( NOT BEING GRADED, SKIP THIS)
walk-the-lake-jacks-map.jev
Write an infinite loop (1 while loop). You may NOT use isWater()

Objective: Your goal is get your jeroo onto the right side of the island. Note that the red areas are nets. You must toss() a flower onto the net before you can go on the net.. You will need the following island file .
The first time that we did this our code looked like this .
![]() |
|
#1)However, we want to create the following custom method custom_method .
#2) Then our “main Section” code should be changed to:
Create the map below
Create the map below
rectangular-lake.jev
1) Starting
<
2) Go around lake, until you are in front of the flower

3) Then pick the flower
Good Links
You will be given a sorting algorithm to research and to present to the class in a powerpoint. Your powerpoint should
Grading Rubric Algorithm Project
|
|
4 |
3 |
2 |
1 |
| Big Oh
(double weight) |
Addresses best/worst/ave cases with clear connection to all aspects of code
|
Addresses best/worst/ave cases but does not relate to all relevant code | Addresses best/worst/ave cases but does not connect to code/is too general | Does not address all 3 cases Big Oh or does not connect to code in meaningful way |
| Animation of algorithm(double weight)
|
Animation is clearly connected to all aspects of code | Animation is connected to critical areas of code | Animation is not clearly connected to actual code | Animation and code are not related to one another |
| Overview(double weight)
|
Gives a clear and enlightening overview of how the algo works in general. | Overview of algorithm is technically correct and discusses most of the relevant features. | Algorithm is vaguely summarized or is not well explicated. | Algorithm is not explained in a meaningful way.
|
|
|
Computer Science club 1/13 in room B100 (not near library, but near the Guidance office)
Let’s write a program that solves the map below (which you should create yourself) using only 1 while loop
![]() |
![]() |
If you just want to do a single test, use an ‘if’ test, instead of a while loop
…Now we can continue hopping till we get to the end of the map
Your Assignment: Create the map above and complete the program . All that you have to do use is the code at the top and then write the custom method goRoundWater()
- Make the map shown below by adding a flower at (0,23)
- Start a Jeroo at (0,0)
- use a single while loop to get your Jeroo to ( 0, 22)
![]() |
![]() |
![]() |
- Make the map shown below
- Start a Jeroo at (1 , 1 )
- use a single while loop until your Jeroo is at ( 1, 21)
![]()