Question: 1. Define a procedure Add that takes parameters and returns the sum of them. > Add( 40 60 ) 100 3. Define a procedure called

1. Define a procedure Add that takes parameters and returns the sum of them.

> Add( 40 60 )

100

3. Define a procedure called Square that will compute the square amount of a value.

3.1 You must implement the Add procedure defined above.

3.2 You will need to account for negative values as well.

Hint: This will require a conditional and possibly the (abs x) procedure.

> (square 7)

49

4. Define a procedure ReadForSquare to read a value for the Square procedure defined above. This procedure takes no values and will pass an input value to the Square procedure.

> (ReadForSquare)

-5

25

5. Define a procedure DiffSquares that will compute the difference between the square values of 2 inputs. You must implement the ReadForSquare procedure defined above. This procedure should never return a negative value, it should return the absolute value.

> (DiffSquares)

5

10

75

6. Re-implement the procedure Add and call it AddLet. In this procedure, you must implementlet-formto bind values. You may name the variables whatever youd like. [5 points]

> (AddLet 60 40)

100

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!