Question: Write a program that will display squares in random colors as illustrated to the right. Each square is filled with a random color. The slider
Write a program that will display squares in random colors as illustrated to the right. Each square is filled with a random color. The slider at the top lets the user choose the number of squares to show, from 0 to 10 (or higher if you would prefer).
Since this is an exercise on recursion, you will use a recursive method to place the squares. The method should have the following header


Program #3 Write a program that will display squares in random colors as illustrated to the right. Each square is filled with a random color. The slider at the top lets the user choose the number of squares to show, from 0 to 10 (or higher if you would prefer). Since this is an exercise on recursion, you will use a recursive method to place the squares. The method should have the following header: " Draw 'number squares in decreasing size and rotated. Each square wil1 be filled with a randomly chosen color * @param number Number of squares to draw. If the number is e or negative, no squares will be drawn. @param rotation Amount to rotate the first square. Should be e or 45 (measured in degrees) @param size The length of each side of the largest square " @param p The pane to which the squares will be added. private void addSquares (int number, int rotation, double size, Pane p)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
