Your task is to create an application program
in BetterTurtle named "PageBorder" that will draw a border
of circles around the page at the desired radius of the user.
You should use either EasyReader or a JOptionPane.showInputDialog(String
msg) (showInputDialog
API) to first get the desired radius from the user. Ask for
AND ENSURE that the user enters a radius between 10 and 25 inclusive.
If they do not, continue asking until they do. (What kind of looping
structure would work best here?)
Once you have the radius, create a new "special" Turtle
using the 3 parameter constructor. What makes this Turtle special
is that the dimensions of the world it creates will be multiples
of the radius.
You are to make the width of the world a multiple of the radius
between 660 and 760 and the height should be between 500 and 600.
The reason for this is to ensure that the circles will be able to
evenly border the page.
Your program should compile and run without error, nor should it
place a circle over one that it has already made.
EXTRA CREDIT LEVEL 1 - Using Arrays/ArrayList - 'PageBorderEC1'
Give the user a list of color names (the possible colors
a Turtle can have) and use a looping structure to allow the user
to choose the colors they would like the Turtle to use to form a
pattern. When they are done choosing colors, they should enter the
word "Quit" and program execution continues, this time
changing the color repeatedly (unless they only enter one color.)
EXTRA CREDIT LEVEL 2 - Increasing Program Versatility to
Customize User Experience - 'PageBorderEC2'
Once the user enters their desired radius, supply the user with
a list of possible screen size options. Rather than show each combination
(there could be a lot!) first get the desired width from the user,
then the desired height. Use these in the Turtle constructor.
EXTRA CREDIT LEVEL 3 - Defining a Circle Class and Increasing
Program Appeal - 'PageBorderEC3'
Once the radius and screen size is determined, populate
a list (your choice of implementation) with the coordinates of every
circle's center and that circle's color. You will need to create
a Circle class to do this with three instance variables: x,
y, and color. The list will be of the
Location type. Then, using a Random number generator, make the circles
appear on the border randomly (therefore using a delay and not going
'straight around') and ensure that when the final circle appears,
the color pattern is as desired by the user. |