Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 4 You are required to design a simple graph plotter which is capable of plotting functions on a pair of axes. The functions to
Question
You are required to design a simple graph plotter which is capable of plotting functions on a pair of axes. The functions to be plotted may be polynomial, sinusoidal, exponential and so on in short, any function which can be expressed in the form:
u fa
Client code must be able to specify the xaxis range, the function to be plotted and the
line style. The plotter code will automatically determine the yaxis range and produce a
plot similar to the example shown in Figure Clients are restricted to using preexisting
functions straight line, quadratic etc and line styles solid dashed, dotted etc which
have been modelled. However, it must be possible to add new function types which fit the form above and line styles without affecting the rest of the plotting code.
Screen Coordinates
Figure : A Simple Graph Plotter
The graph should be centred on the screen. In other words, the data point which lies in the middle of the xaxis range should be plotted in the centre of the screen. The Allegro graphics library will be used to do the plotting and each plot will be approximated by many short, straight linesdashes etc. Remember, that the origin of the screen coordinates, as determined by Allegro, is different to that of the graph coordinates. The screen's origin is at the topleft corner, as illustrated in Figure
Screen Coordinates
ELEN Software Development II pages page
Draw a UML diagram illustrating all the classes required for modelling the above system. On your diagram, show the key public member functions for each of your classes give the complete signatures and the relationships between classes, including navigability and multiplicity, where appropriate. Also provide a brief, written explanation of the main responsibilities of each of your classes.
Note, in modelling the problem be careful to separate the presentation layer from the application logic layer.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started