Question: I need help with the following question in Erlang programming language. Please answer 1 to 9 if you can't I will submit another question. Thanks
I need help with the following question in Erlang programming language. Please answer 1 to 9 if you can't I will submit another question.


Thanks for helping
lab04.eri screenshot/s of running lab04.erl in the shell showing various function calls (png, jpg, or gif) (capture any 4 function calls total, each one should illustrate a call to a different function though: 2 screenshots should be for one partner and 2 for the other) In the text editor of your choosing create a file lab04.erl and write function definitions that could be run from the shell - make sure you use the exact same names (anything in italics) as indicated in function descriptions. Pay attention to directions that specify what syntactical mechanisms to use within the functions (the purpose of this lab is to make sure you are familiar with most of the basic Erlang syntax discussed this week). 1. Function coneArea that takes two arguments that represent the radius of the base of a right circular cone and the height of that cone (in this order) and returns the surface area of that cone using the following formula: A = u(r+h+r) you do NOT have to guard against invalid input, use pi and square root defined in the math library 2. Function is Different that takes two arguments and returns false if these two values are the same considering both the value and the type, i.e. if 5.0 and 5 are passed, the function should return true because these two parameters have different data types; if S and 5 are passed, the function should return false because these two parameters have the same value and data type 3. Function smallerOne that takes two arguments and returns the smaller one - use the if statement inside the function body; if elements have the same value, returns either one 4. Function displayProperty that takes two arguments and evaluates whether they are odd or even or mixed. The function should print the following to the console: the incoming arguments (use the format specifier that will be appropriate for either floats or ints) the message: "Both are even if each one is an even number "Both are odd" f each one of them is an odd number "One is odd, one is even if one of the arguments is odd and the other one is even To write a boolean expression inside an it, use parenthesis around expressions, eg, 1x > 0) and (Y>0). You may also solve this using nested its but then remember not to end a nested in with a period since the period indicates the end of a function. In this function we are not interested in a return value, although Erlang always retums, so write it as if Erlang did not always return (e. do not worry what this function will return, focus on what it is to Function planets that takes an argument and returns its equivalent gas planet from our Solar System as an atom using a case expression, where: 0 print 5 . . . for value 1 returns jupiter for value 2 returns saturn for value 3 returns uronus for value 4 returns neptune for an invalid value, returns no_match 6. Function planets2 that works in the exact same fashion as planets, except uses function level pattern matching (several function clauses/headers) instead of a case expression inside a function 7. Function myged that implements the recursive math formula provided below - do NOT write any if statements or case expressions inside the function body but rather use function level pattern matching m Fm for m, n > 0. god (m, n)- gem-n) fm > gom, nm) mn When testing this function, mygcd(12, 6) should result in 6, myged(2, 6) should result in 2, and mygcd/5, 5) should result in 5. If either mornare 0) and (Y>0). You may also solve this using nested its but then remember not to end a nested in with a period since the period indicates the end of a function. In this function we are not interested in a return value, although Erlang always retums, so write it as if Erlang did not always return (e. do not worry what this function will return, focus on what it is to Function planets that takes an argument and returns its equivalent gas planet from our Solar System as an atom using a case expression, where: 0 print 5 . . . for value 1 returns jupiter for value 2 returns saturn for value 3 returns uronus for value 4 returns neptune for an invalid value, returns no_match 6. Function planets2 that works in the exact same fashion as planets, except uses function level pattern matching (several function clauses/headers) instead of a case expression inside a function 7. Function myged that implements the recursive math formula provided below - do NOT write any if statements or case expressions inside the function body but rather use function level pattern matching m Fm for m, n > 0. god (m, n)- gem-n) fm > gom, nm) mn When testing this function, mygcd(12, 6) should result in 6, myged(2, 6) should result in 2, and mygcd/5, 5) should result in 5. If either mornare
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
