main() { open java.io.FileReader on the file named in `args[0]` open java.util.Scanner on the file reader scan in n as an Int scan in radius as a Double create & initialize px, py, vx, vy, mass to be DoubleArray of size n create & initialize bodyName to be an Array of size n, with each element initialized to empty string for i from 0 to n { scan in px[i] scan in py[i] scan in vx[i] scan in vy[i] scan in mass[i] scan in a name and assign appropriate path name to bodyName[i] } close the scanner close the file reader call the main method of Papplet } class NbodyPApplet { settings() { set the size of display window equal to the size of your background image } setup() { load background image for each body do load image corresponding to its name intialize minim load music file play music set frame rate if desired } fun transformX(x) { return the corresponding processing value of x-coord for the given x coord in Cartesian system } fun transformY(y) { return the corresponding processing value of y-coord for the given y coord in Cartesian system } fun draw() { for each body i do { for each body j different from i do { use Newton's formula to compute the gravitational force exerted by j on i break the force into an x component & y component, and update this into the total forces acting along x axis & y axis on i } update vx[i] using the total force along x axis on i & mass of i update vy[i] using the total force along y axis on i & mass of i } display background image for each body i do { compute the new px[i] using vx[i] & deltaT compute the new py[i] using vy[i] & deltaT show the image of i at the processing point specified by (px[i], py[i]) in Cartesian system } /* debug statements as suggested in Checklist go here */ } }