Metric Conversion
Mix.install([
{:kino, github: "livebook-dev/kino", override: true},
{:kino_lab, "~> 0.1.0-dev", github: "jonatanklosko/kino_lab"},
{:vega_lite, "~> 0.1.4"},
{:kino_vega_lite, "~> 0.1.1"},
{:benchee, "~> 0.1"},
{:ecto, "~> 3.7"},
{:math, "~> 0.7.0"},
{:faker, "~> 0.17.0"},
{:utils, path: "#{__DIR__}/../utils"},
{:tested_cell, git: "https://github.com/BrooklinJazz/tested_cell"}
])
Navigation
Metric Conversion
You are building an app to help people handle converting measurements according to the following chart.
Utils.table(:measurements)
Users may provide any measurement and a value in a tuple {measurement, value}
, and convert
it to any other measurement like so.
Measurement.convert({:meter, 1}, :centimeter)
{:centimeter, 100}
Use the measurements provided by the table to convert values, even when this would deviate from
how these measurements are typically converted. For example, 12 inches is typically 1 foot, however
according to this table it would be 1.016
feet.
Measurement.convert({:inch, 12}, :feet)
{1.016, :feet}
Enter your solution below.
defmodule Measurement do
def convert(from, to) do
end
end
Utils.feedback(:metric_measurements, Measurement)
Commit Your Progress
Run the following in your command line from the project folder to track and save your progress in a Git commit.
$ git add .
$ git commit -m "finish metric conversion exercise"