7. Exercise Set 2

Exercise 2.1: Three Circles

Given: an array of three real values, r, for the radii of three circles;
Compose: a let-in statement that returns two arrays containing the areas and circumferences of the circles of the given radii.
Click here for a sample answer.

Exercise 2.2: More Statistics

Given: four three-element arrays, a, b, c, and d, all containing real numbers;
       the formulas for the mean and standard deviation
            mean = (a+b+c+d)/4;
            standard deviation = (((a-mean)**2 + (b-mean)**2 +
                                   (c-mean)**2 + (d-mean)**2) / 3)**0.5
Compose: a let-in statement that returns an array of records, each containing the mean and standard deviation of one of the given sets of numbers.
Click here for a sample answer.

Previous Section



Next Section



Table of Contents