Elixir Course Online | Prograils - Software Development Company
Modules and named functions exercises
Exercises
Create
Greetermodule withhello_worldfunction which prints "Hello world". Load it intoIExwith different approaches to compile the file and check if it works.Extend
Integermodule with azero?function which returns true if given integer is zero.Create
circle_surface_areafunction inside ofMathmodule, which calculates the surface area of a circle. Use@piattribute.Create
factorialfunction which calculates the factorial of the given number. It should use recursion and pattern matching to bind different arguments.Create
fibonaccifunction which for given n number will print n-th fibonacci number.Create nested module
School.Class.Teacherand give it an aliasProfessor.Create a
contain_digits?function insideCheckermodule which takes a chars list as an argument and checks if it contains digits. Checking itself should be performed inside of a private function and result should be printed as a string message. Tip: checkString.graphemes.
