Session Ready
Exercise

Converting areas to metric 1

In this chapter, you'll be working with grain yield data from the United States Department of Agriculture, National Agricultural Statistics Service. Unfortunately, they report all areas in acres. So, the first thing you need to do is write some utility functions to convert areas in acres to areas in hectares.

To solve this exercise, you need to know the following:

  1. There are 4840 square yards in an acre.
  2. There are 36 inches in a yard and one inch is 0.0254 meters.
  3. There are 10000 square meters in a hectare.
Instructions 1/3
undefined XP
  • 1

    Write a function, acres_to_sq_yards(), to convert areas in acres to areas in square yards. This should take a single argument, acres.

    • 2

      Write a function, yards_to_meters(), to convert distances in yards to distances in meters. This should take a single argument, yards.

    • 3

      Write a function, sq_meters_to_hectares(), to convert areas in square meters to areas in hectares. This should take a single argument, sq_meters.