CPSC120A
Fundamentals of Computer Science I

Post-lab 12

Scope

Do one of the following programming problems:

Population

Write a function called estimate_population(starting_population, years_later) which will estimate how large a population will be after years_later, if it has the specified starting population. Assume there is 1 birth every 7 seconds, and a death every 12 seconds.


Ring Area

Write two functions:

  1. circle_area(radius) that returns the area of a circle with the specified radius.
  2. ring_area(inner_radius, width) that returns the area of the ring with the specified radius and width. This function should call the circle_area function. The following image illustrates the inner radius and width of a ring.