Advertisement
onyougoson

second.erl

Jun 21st, 2017
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Erlang 0.36 KB | None | 0 0
  1. %first.erl:
  2. treble(X) ->
  3.     mult(3,X).
  4. square(X) ->
  5.     X*X.
  6. %second.erl:
  7. -module(second).
  8. -export([hypotenuse/2,perimeter/2,area/2]).
  9.  
  10. hypotenuse(A,B) ->
  11.    C = first:square(A) + first:square(B),
  12.    math:sqrt(C).
  13.  
  14. perimeter(A,B) ->
  15.    C = second:hypotenuse(A,B),
  16.    A + B + C.
  17.  
  18. area(A,B) ->
  19.    C = second:hypotenuse(A,B),
  20.    first:area(A,B,C).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement