//Sticks.java import java.awt.*; import javax.swing.*; public class Sticks extends JApplet { int count; public void init() { String input; input = JOptionPane.showInputDialog( "Enter number of points"); count = Integer.parseInt( input ); } public void paint (Graphics g) { //first random point int x1=(int)(Math.random()*getWidth()); int y1=(int)(Math.random()*getHeight()); //"remember" original first point int startx = x1; int starty = y1; int x2, y2; double len, sumLen=0, avgLen; double sumDistStart=0, distStart, avgDistStart; for (int i=1; i