created 05/24/03

# Chapter 41 Programming Exercises

Many of your programs from previous chapters can modified by changing while loops into the equivalent for loops. Some of these exercises are repeats of previous ones.

## Exercise 1 --- Sheep Herd Size

A breeding group of 20 bighorn sheep is released in a protected area in Colorado. It is expected that with careful management the number of sheep, N, after t years will be given by the formula:

N = 220/(1 + 10(0.83)t )

and that the sheep population will be able to maintain itself without further supervision once the population reades a size of 80.

Write a program (using a for loop) that writes out the value of N for t starting at zero and going up to 25. How many years must the sheep heard be supervised?

Hint: don't calculate (0.83)t   "from scratch" each time the formula is used. Use a variable power that is multiplied by 0.83 in each iteration of the loop. What value should it be initialized to?

(Problem from Howard Anton, Calculus, 6th ed., p. 105. )