UNB/ CS/ David Bremner/ teaching/ java/ PlotData1.java
import ccj.*;

public class PlotData1 extends GraphicsApplet
{  public void run()
   {  int n = readInt("How many data points?");
      String[] names = new String[n];
      double[] prices =  new double[n];
      int[] scores = new int[n];

      int i;
      for (i = 0; i < n; i++)
      {  names[i] = readString("Product name:");
         prices[i] = readDouble("Price:");
         scores[i] = readInt("Score:");
      } 

      setCoord(0, MAX_SCORE, MAX_PRICE, 0);

      for (i = 0; i < n; i++)
      {  Message label = new Message(new Point(prices[i],
            scores[i]), names[i]);
         label.getStart().draw();
         label.draw();
      }
   }

   private static double MAX_PRICE = 10000;
   private static double MAX_SCORE = 100;
}