Elixir Orbits calculation program

Job ID: 33305822

Budget: $30 – $250 CAD

You are given file a2.ex which contains a function called process that accepts a string of an input file. A skeleton of this is already provided, along with a main. You are given a2_test.exs which contains function solarSystem which contains all the input data.

"Sun 57909227 Mercury
Earth 384400 Moon
Sun 149598262 Earth
Moon 1757 LROrbiter
Mars 9376 Phobos
Mars 23458 Deimos
Sun 227943824 Mars
Sun 778340821 Jupiter
Sun 1426666422 Saturn
Sun 2870658186 Uranus
Sun 4498396441 Neptune
"

When run via iex -S mix, the above methods would return results.

1. Your code will be tested via both iex -S mix and mix run.
2. You should be able to run tests with:

mix test

and it should at least run the provided test.

3. I should be able to run your program by entering the following code:
$ iex -S mix
Interactive Elixir (1.13.2) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> A2.main()
Sun 42 Earth
Earth
Sun
end-of-file entered here ^D on Linux/MacOSX
Earth orbits Sun
Sun orbits
:ok
iex(2)>
Note that the format function returns a string; it does no I/O. Piping it to IO.write formats it with the newline character interpreted appropriately.
Related categories: Elixir