
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Programming Assignment # Due: Wednesday, December 12, 11:59pm
Design an MS Java++ 6.0 program that interactively displays graphs of several basic functions depending on the selected parameter 1 โค N โค 10. The program window is supposed to consist of a canvas area that displays the graph f(x) with both axes drawn and scaled. Each of the three types of functions has to be displayed in different color. The x axis extends from 0 to 5 while the scale of the y axis depends on the displayed function and is chosen so that the graph essentially fills the whole area of the canvas (minimizes the white-space).
The window also contains a control area which consists of:
A โNewโ button that displays the graph of a chosen function for the selected N after first clearing the canvas area. The New button should be only active if the type of the function and the number N have been already selected.
An โAddโ button that adds the graph of the newly selected function to the previous graph(s). This button should be only active if some other function is already displayed and if the type of the new function and the number N have been properly selected. It should allow us to choose only a function of a different type than the one(s) already displayed in the canvas area. Otherwise, an error message should be issued. In particular, at most three different graphs can be displayed at the same time.
A โClearโ button that clears the canvas area and all the control fields.
A pushdown list (initially set to
Exponential, i.e., Nx Power, i.e., xN Sinus, i.e., sin(Nx).
A text input field (initially blank) through which one can change the parameter N.
Two text fields (initially blank) which display the values of x and f(x) whenever a mouse moves over a point on the canvas area with the x coordinate, where f(x) is the last selected function (if any).
A label area that shows the list of all currently displayed functions with the last chosen function listed first.