Java Genesis

Hints for Chapter 5: Arrays

Problem 1: square roots of 10 integers

First we have to declare a variable squareRoots of array type double of length 10:

 

        double [] squareRoots = new double [10];
Taking the class PerfectSquares as a guide, use the above declaration to complete the code for the class SquareRoots before looking at the final hint.

Next Hint