CircleAnimations import java.awt.Color; import java.util.ArrayList; import java.util.List; import java.util.Random; ArrayList = ArrayList array(); public class CircleAnimations {
Question:
CircleAnimations
import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
ArrayList = ArrayList array();
public class CircleAnimations
{
private ArrayList circles; //the circles to animate
private int size; //canvas width and height (will be square)
private Random rng; //use to make random numbers
/** create a drawing pane of a particular size */
public void drawCircles() {
for(int i = 0; i < array.size(); i++) {
StdDraw.setPenColor(circles[i], circles[i + 1], circles[i + 2]);
StdDraw.setPenColor();
}
}
public void addCircles() {
}
public CircleAnimations(int s) {
circles = new ArrayList<>();
size = s;
rng = new Random();
//don't mess with this
StdDraw.setCanvasSize(size, size); //set up drawing canvas
StdDraw.setXscale(0, size); //<0, 0> is bottom left. is top right
StdDraw.setYscale(0, size);
}
}
CircleRunner
import java.awt.*;
public class CircleRunner {
public static void main(String[] args) {
CircleAnimations app = new CircleAnimations(600); //supply window size, will be 600x600
//test your methods below (with the app object)
// testCircleOverlap(); //uncomment to test your overlap method, when required
}
public static void testCircleOverlap() { //uncomment contents to use
/*
* The distance between a and b is ~2.83, which is greater than the combined radius of 2 (a and b do NOT overlap)
*
* The distance between a and c is ~2.83, which is less than the combined radius of 6 (a and c overlap)
*/
// Circle a = new Circle(1, 1, 1, null); //color is irrelevant for this
// Circle b = new Circle(3, 3, 1, null);
// Circle c = new Circle(3, 3, 5, null);
//
// System.out.println(a.overlaps(b)); //should print false
// System.out.println(a.overlaps(c)); //should print true
Complete the circle java and circle animations java as per the given instructions in the question docx
Foundations of Financial Management
ISBN: 978-1259024979
10th Canadian edition
Authors: Stanley Block, Geoffrey Hirt, Bartley Danielsen, Doug Short, Michael Perretta