Important to use Eclipse IDE and JAVA 1.8. Basically What is required is to make a simple simulation where there is food (spawning), 3 insects, 6 nonpredatory birds, and 2 predators running around on...

1 answer below »
Important to use Eclipse IDE and JAVA 1.8. Basically What is required is to make a simple simulation where there is food (spawning), 3 insects, 6 nonpredatory birds, and 2 predators running around on the screen. not much action going on, and not much functionality either. (simple collision and boundary detection). But what is important in this assignment is that they test the inheritance in the code. So they want to have a parent class of an animal and a child class of insect, bird, and predator. The key constructs that we are practicing here subclass, abstract class, keywords to modify field and method access, and polymorphism, i.e creating a collection(s) of objects of different kinds that may be interrelated via inheritance.The detail specification tells you what you application should be doing and how it should be responding to the user interaction. Here we are concerned with the quality of the design of the class hierarchy. However, your application needs to show a populated environment of the animals of specified kinds that are moving on the screen. Hence, not much of the functionality, basically the code that displays animals should be working.
Answered 1 days AfterFeb 13, 2021

Answer To: Important to use Eclipse IDE and JAVA 1.8. Basically What is required is to make a simple simulation...

Shweta answered on Feb 15 2021
153 Votes
75860Solution/301326320-A2P1/.classpath

    
        
            
        
    
    
    
75860Solution/301326320-A2P1/.project

     301326320-A2P1
    
    
    
    
        
             org.eclipse.jdt.core.javabuilder
            
            
        
    
    
         org.eclipse.jdt.core.javanature
    
75860Solution/301326320-A2P1/.settings/org.eclipse.jdt.core.prefs
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve

org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
75860Solution/301326320-A2P1/bin/Animal.class
public abstract synchronized class Animal {
protected java.awt.geom.Ellipse2D$Double body;
protected java.awt.geom.Arc2D$Double head;
protected double animalX;
protected double animalY;
protected double xSpeed;
protected double ySpeed;
protected double scale;
protected double maxSpeed;
protected boolean alive;
public static final int HEAD_WIDTH = 12;
public static final int BODY_WIDTH = 34;
public static final int ANIMAL_HEIGHT = 30;
public void Animal(double, double, double, double, double);
public void setBodyAttributes();
public void setHeadAttributes();
public void drawAnimal(java.awt.Graphics2D);
boolean detectCollision();
public void move();
private void detectBound();
public void killed();
public double getBugX();
public double getBugY();
}
75860Solution/301326320-A2P1/bin/AnimalPanel.class
public synchronized class AnimalPanel extends javax.swing.JPanel implements java.awt.event.ActionListener {
public static final int SPACE_W = 600;
public static final int SPACE_H = 400;
public static final int SPACE_X = 100;
public static final int SPACE_Y = 50;
private java.awt.geom.Rectangle2D$Double space;
private javax.swing.Timer timer;
private int count;
private Animal[] animal;
private Food food;
public void AnimalPanel();
public void paintComponent(java.awt.Graphics);
public void actionPerformed(java.awt.event.ActionEvent);
}
75860Solution/301326320-A2P1/bin/AnimalWorld.class
public synchronized class AnimalWorld extends javax.swing.JFrame {
public void AnimalWorld(String);
public static void main(String[]);
}
75860Solution/301326320-A2P1/bin/Food.class
public synchronized class Food {
protected java.awt.geom.Ellipse2D$Double food1;
protected java.awt.geom.Ellipse2D$Double food2;
protected java.awt.geom.Ellipse2D$Double food3;
public static final int SPACE_H = 400;
public static final int SPACE_W = 600;
public static final int SPACE_X = 100;
public static final int SPACE_Y = 50;
public void Food();
public void setBodyAttributes();
public void drawFood(java.awt.Graphics2D);
}
75860Solution/301326320-A2P1/bin/Insect.class
public synchronized class Insect extends Animal {
java.awt.Color bodyColor;
java.awt.Color dotColor;
protected java.awt.geom.Ellipse2D$Double dot;
protected java.awt.geom.Ellipse2D$Double dot1;
protected java.awt.geom.Ellipse2D$Double dot2;
protected java.awt.geom.Ellipse2D$Double dot3;
protected java.awt.geom.Line2D$Double line;
protected java.awt.geom.QuadCurve2D$Double upAntenna;
protected java.awt.geom.QuadCurve2D$Double dnAntenna;
public static final int DOT_SIZE = 6;
public void Insect(double, double, double, double, double);
public void setBodyAttributes();
public void setHeadAttributes();
boolean detectCollision();
public void drawAnimal(java.awt.Graphics2D);
}
75860Solution/301326320-A2P1/bin/NonPredatoryBird.class
public synchronized class NonPredatoryBird extends Animal {
java.awt.Color bodyColor;
java.awt.Color dotColor;
protected java.awt.geom.Ellipse2D$Double dot;
protected java.awt.geom.Ellipse2D$Double dot2;
public static final int DOT_SIZE = 16;
public void NonPredatoryBird(double, double, double, double, double);
public void setBodyAttributes();
public void setHeadAttributes();
boolean detectCollision();
public void drawAnimal(java.awt.Graphics2D);
}
75860Solution/301326320-A2P1/bin/PredatoryBird.class
public synchronized class PredatoryBird extends Animal {
java.awt.Color bodyColor;
java.awt.Color dotColor;
protected java.awt.geom.Ellipse2D$Double dot;
protected java.awt.geom.Ellipse2D$Double dot2;
public static final int DOT_SIZE = 16;
public void PredatoryBird(double, double, double, double, double);
public void setBodyAttributes();
public void setHeadAttributes();
boolean detectCollision();
public void drawAnimal(java.awt.Graphics2D);
}
75860Solution/301326320-A2P1/bin/Util.class
public synchronized class Util {
public void Util();
public static double random(double,...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here