18.  Iterative Loops I:  While:  Problems

Last revision:  March 23, 1998

Author: YourNameGoesHere

Even the Last

Using "While[]", define a function that finds the last even number in a list of numbers.  (Make sure you handle the case of an empty list of numbers.)

iterFixedPointList

Use "While[]" to implement your own version of the function "FixedPointList[]", called "iterFixedPointList[]".  Of course, don't use "FixedPointList[]" in your definition..

Scoring a Random A

On average, how many random integers between 1 and 100 do you need to generate before you get one larger than 95?  Use a "While[]" construct to simulate this problem.

Recursion Reprise

Iteration (as in a "While[]" loop) is an alternative to primarily list-based functional programming or recursion.  Write a recursive version of "firstNeg[]".  (A tail recursive version is preferred.)