Assignment 5 Procedures and Decision
Assignment 5 Procedures and Decision
A. Evaluate the following scheme expression below and construct the parse tree accordingly:
B. Find the scheme procedure and name definition for the following scheme decision expression:
a. absvalue, that takes a number as input and produces the absolute value of that number
as its output. For example, (absvalue 3) should evaluate to 3 and (absvalue −150)
should evaluate to 150.
b. bigger-magnitude, that takes two inputs, and outputs the value of the input with the
greater magnitude (that is, absolute distance from zero). For example, (bigger-
magnitude 5 −7) should evaluate to −7, and (bigger-magnitude 9 −3) should evaluate to
9.