Exercise Answers


5.1
   THIS METHOD IS IN THE FILE Divisibility.java
-------------------------------------------------------------------------------------------------------------------------

5.2
   The output was:

   true
   true
   ping!
   pong!
-------------------------------------------------------------------------------------------------------------------------

5.3

   THIS METHOD IS IN THE FILE Distance.java
   
   The points were (1,2) and (3,4) and the output was 2.8284271247461903
   
   P.S. The methods distance(), sumsquares(), and main() were written.
-------------------------------------------------------------------------------------------------------------------------

5.4

   THIS METHOD IS IN THE FILE Multadd.java

   The output was: 10.0
-------------------------------------------------------------------------------------------------------------------------

5.5

   main [          ]
   prod [m[1] n[4] recurse[]]
   prod [m[1] n[3] recurse[]]
   prod [m[1] n[2] recurse[]]
   prod [m[1] n[1] ]
-------------------------------------------------------------------------------------------------------------------------

5.6

   THIS METHOD IS IN THE FILE Ackerman.java

   The output was 1
-------------------------------------------------------------------------------------------------------------------------

5.7

   THIS WHOLE EXERCISE WAS ATTEMPTED IN THE FILE Recurse.java

   The output:
   a
   b
   c
   c
   b
   a
   cba
-------------------------------------------------------------------------------------------------------------------------

5.8

   THIS PROGRAM IS IN THE FILE Sum.java
   the appropriate comments, and print statement have been added, no better names were found, however as the functions  were too abstract.
-------------------------------------------------------------------------------------------------------------------------

5.9

   THIS PROGRAM IS IN THE FILE Power.java
   The output was 125.0 7.302361908311559E201
-------------------------------------------------------------------------------------------------------------------------

5.10

   THIS PROGRAM IS IN THE FILE GCD.java
   The output was 2
-------------------------------------------------------------------------------------------------------------------------
