Question: CODE IN ERLANG 1. Function money that that takes two tuples, where each tuple represents a money object (each tuple consists of 2 values: dollars
CODE IN ERLANG

1. Function money that that takes two tuples, where each tuple represents a money object (each tuple consists of 2 values: dollars and cents) and calculates and returns a new tuple that constitutes the addition of the incoming money objects (dollars + dollars, cents + cents). Assume valid positive integers will be passed and do NOT error check. Normalize the values, i.e. if the cents addition results in a value > 99, adjust dollars and cents properly (hint: to pattern match a function on a tuple consisting of 2 elements, you can use functionName({X, Y}) -> ... type of a syntax) 1. Function money that that takes two tuples, where each tuple represents a money object (each tuple consists of 2 values: dollars and cents) and calculates and returns a new tuple that constitutes the addition of the incoming money objects (dollars + dollars, cents + cents). Assume valid positive integers will be passed and do NOT error check. Normalize the values, i.e. if the cents addition results in a value > 99, adjust dollars and cents properly (hint: to pattern match a function on a tuple consisting of 2 elements, you can use functionName({X, Y}) -> ... type of a syntax)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
