CPSC120B
Fundamentals of Computer Science I

Post-lab 13

Function Scope

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 return 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.