import java.util.*; public class Ball extends PhysicsElement implements Attachable{ private static int id=0; // Ball identification number private final double mass; private double pos_t; // current position at time t private double pos_tPlusDelta; // next position in delta time in future private double speed_t; // speed at time t private double speed_tPlusDelta; // speed in delta time in future private double a_t; // acceleration at time t private double a_tMinusDelta; private Spring spring=null; private Ball(){ // nobody can create a ball without state this(1.0,0,0); } public Ball(double mass, double position, double speed){ super(id++); this.mass = mass; pos_t = position; speed_t = speed; } public double getPosition() { return pos_t; } public void attach(Spring s){ // to be coded } private double getNetForce(){ return spring.getForce(this); } public void computeNextState(double delta_t) { // to be coded } public void updateState(){ // to be coded } public String getDescription() { // to be coded by you } public String getState() { // to be coded by you } }