User Tools

Site Tools


This is an old revision of the document!

CSci 326: Daily 3

Define each of these functions in a module Daily3. Place the module in a file daily3.exs along with code to exercise the functions (and print the results) using the tests given below. For the second and third function, add two tests of your own (along with expected results). This script should run properly using the elixir program which is how I'll test them.

While you are developing your solutions, you can try things out in iex, but you'll have to look up the compile command.

  1. Write a function Test with:
    • Daily2.average(10, 10)
    • Daily2.average(5, 7)
    • Daily2.average(5, 8)
    • Daily2.average(5.0, 8.0)
    • Daily2.average(12.4, 13.7)
  2. Define something which
  3. Hey
    • For example, Daily2.quad-roots(2, 7, 5) would return {-1.0 -2.5}
    • Hint: returning two values as a tuple is super easy. Consider:
cs326/daily3.1517195341.txt.gz · Last modified: 2018/01/28 21:09 by scarl