For example, we would like to know how long it takes a Custodian to clean a restroom based on their skill level.
So we've made a method that does that.
The first thing we do is define an accumulator variable. We do this so we have a place to hold a value and also add to it.
If we define the method as it is below we'd get an error because the variable timeTaken will "die off" every time the ending curly brace is hit. The return statement can't access it because it is not in the same scope.
The next things we do is define a while loop that reduces the DirtyLevel by 1 and then increases the timeTaken by 60% of whatever their skill level is.
When we run the application the first time the while loop executes and adds 1.799 to the timeTaken accumulator variable.
When the while loop executes the second time another 1.799 is added to the timeTaken accumulator variable.
After it loops another 78 times, we return the timeTaken variable to its caller.