TODO: Generate a report from a csv file
Given a csv file containing name, hours, day, month and year of 10 freelancers, return all hours, hours per month and hours per year.
Consider 30 days in every month.
Do not consider leap year.
See the the lib files to learn how to run with iex.
Names | Hours | Day | Month | Year |
---|---|---|---|---|
name 1 | 10 | 5 | 1 | 2016 |
name 2 | 18 | 30 | 2 | 2017 |
name 3 | 17 | 10 | 3 | 2018 |
name 4 | 18 | 7 | 4 | 2019 |
name 5 | 6 | 25 | 12 | 2020 |
mix deps.get
mix compile
mix test
- See the lib files and read the @doc.
- Open iex with command
iex -S mix
. - Run the line
iex> <code_to_run>
in your iex.
%{
all_hours: %{
name: all_hours,
name: all_hours,
...
},
hours_per_month: %{
name: %{
month: hours_per_month,
month: hours_per_month,
...
},
name: %{
month: hours_per_month,
month: hours_per_month,
...
}
},
hours_per_year: %{
name: %{
year: hours_per_year,
year: hours_per_year,
...
},
name: %{
year: hours_per_year,
year: hours_per_year,
...
}
}
}