CMSI 186 Homework #7
Function Plotter
Due 4 pm, Thursday, May 3
- Design and construct FunctionPlotter.java, a GUI-based application for plotting functions of a single variable. When your program is started, it will:
- Interact with the user to determine some specific function to be plotted. For example, the chosen function might be f(x) = cos (x), or f(x) = 3.2 x^2 - 15.1 x + 6.345.
- Interact with the user to determine the range within which the function should be plotted. This involves getting a lower-bound and an upper-bound for x.
- Plot the function within the specified range.
- An ideal program will present the user with choices about what to plot, such as:
-
polynomials of arbitrary degree;
-
trigonometric functions such as sin (x), cos (x), tan (x), arctan (x);
-
logarithmic and exponential functions such as ln (x), exp (x);
-
some combination of the above-named functions (hard).
-
It is up to you to design and implement the interface through which users will interact with your program, most likely involving things like buttons, checkboxes, editable textfields, etc. You will want to read and experiment with a lot of the material in Java Examples in a Nutshell and Java Foundation Classes in a Nutshell.
-
Check out the listings for the first few illustrative programs that we discussed in class:
Revised: April 11, 2007