import java.util.*; import java.lang.*; import java.io.*; class My2dPoint { double x; double y; public My2dPoint(double x1, double y1) { x=x1; y=y1; } } public class HW6 { public static void main (String argv []) throws IOException { int range = 100; // Range of x and y coordinates in points My2dPoint src = new My2dPoint(5.1, 5.1); My2dPoint trg = new My2dPoint(95.1, 95.1); LinkedList pointList = new LinkedList(); double bound = 1.5; double r; double threshold = 0.2; for (int i = 0; i < 101; i++) { for (int j = 0; j < 101; j++) { r = Math.random(); if (r > threshold) pointList.add(new My2dPoint(i,j)); } } /* You can add the call to the method that you will write here. It should take src, trg, pointList, and bound as arguments, and print the answer it computes */ /* The following is just to remind/tell you about how to look at the points in pointList. Comment out this piece of code in the end. */ My2dPoint p; ListIterator itr = pointList.listIterator(0); while (itr.hasNext() ) { p = itr.next(); System.out.println(p.x + " ; " + p.y); } } }