Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

CS 143 Assignment 5 Your job is to use GUI and Graphics to develop a simple func

ID: 3550199 • Letter: C

Question

CS 143 Assignment 5

Your job is to use GUI and Graphics to develop a simple function grapher. At a minimum it should: 1. Allow user to specify the window of the part of the Cartesian plane to graph (xmin, xmax, ymin, ymax) 2. Accept at least 4 parameters which can modify the function 3. Display on a label the formula for the function (it is OK to copy-and-paste part of your code as I have done below). 4. Invert y-coordinates so that functions are graphed in their usual y-up orientation of math classes. 5. Have a title bar with your name in it 6. Have a button to do the actual graphing.

Here is a screen shot of a suitable minimal implementation:

(below)

Here is the graph output from my minimal implementation:

(below)

The user interface is partially the GUI, and partially in the actual code itself, where the user will code the function to be graphed.

A minimal implementation is worth 70 points. A minimal implementation may use the DrawingPanel class on the class website. Doing more can take you to or beyond 100.

Extra credit opportunities:

1. Dont use DrawingPanel, but construct your own Graphics object using Swing. (10 pts) 2. Display and properly label axes with appropriate tic marcs and tic labels. Usually, there is a tic interval (in units of x or y), indicating how often tic marks are placed on the axis, and a labeling interval, indicating how often tics are labeled with numbers. (10 pts) 3. Allow users to specify size and background color of the graphing window. (5 pts) 4. Design an interface that requires: (5 pts) a. A double method named f that accepts a double argument (x) and evaluates a function to be graphed. b. A toString() method that provides a description of the function. Write a class that implements the interface and calculates an interesting function for graphing. 5. Add and use a method to the class that returns a suggested window. (3 pts) 6. Extend the program to allow graphing more than one function, using different colors for the different functions. 7. (this one will probably require finding and using an appropriate class you find on the web) Make the user interface so that the user can type in one or more expressions into field(s) on the GUI. (20 pts) 8. Display the function string on the output graph. (3 pts) 9. Display multiple function strings on the output graph, in different colors, matching the colors you use for drawing the different functions. (10 pts) 10. Provide the opportunity to make a scatterplot from x and y arrays of data. Provide a user interface so that the user can point to a file in .csv format (JFileChooser, no?)with x and y data. (x in one column, y in the other) (25 pts) 11. Implement as an applet with associated .html file (20 pts)

You must calculate your own score and propose it (with justifications)

Your job is to use GUI and Graphics to develop a simple function grapher. At a minimum it should: Allow user to specify the window of the part of the Cartesian plane to graph (xmin, xmax, ymin, ymax) Accept at least 4 parameters which can modify the function Display on a label the formula for the function (it is OK to copy-and-paste part of your code as I have done below). Invert y-coordinates so that functions are graphed in their usual "y-up" orientation of math classes. Have a title bar with your name in it Have a button to do the actual graphing. Here is a screen shot of a suitable minimal implementation: Here is the graph output from my minimal implementation:

Explanation / Answer

Deadline for this assignment ?