Implementation of a Graphics Package (Due 31 Oct 2003)

Develop a class called Plot which will have the following form:
class Plot extends JFrame
{
  // Constructors
  public Plot ()
  {
    ...
  }

  public Plot ( String frameTitle )
  {
    ...
  }

  public void drawGraph ( double[] x, double[] y, String graphTitle,
			  String xLabel, String yLabel, String color )
  {
    ...
  }
}
If the color specified by the user does not match the 13 standard colors, the default color is black. Modify the graphing routine already given to you in class.

Write a class TestPlot that will create a Plot object. It will generate the two arrays x and y from the equation y ( x ) = sin ( x ) + 2.0 * cos ( x ). The range of x is between -π and π. It will call on the method drawGraph to plot the results.

The file that you will be turning in will be called TestPlot.java. It will have both the classes Plot and TestPlot. The file will have a header of the following form:

/*
  File: TestPlot.java

  Description:

  Student Name:

  Student UT ID:

  Course Name / Unique Number: CS 313E / 52320

  Date Created:

  Date Last Modified:

*/

Use the turnin program to submit the TestPlot.java file. The TA should receive your work by 11 PM, Friday, 31 October 2003.