Answered step by step
Verified Expert Solution
Link Copied!

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 4
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 f(a)
Client code must be able to specify the x-axis range, the function to be plotted and the
line style. The plotter code will automatically determine the y-axis range and produce a
plot similar to the example shown in Figure 1. Clients are restricted to using pre-existing
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 Co-ordinates
-6
-3-2
654
32
1
-23--4-5-6
123456
Figure 1: 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 x-axis 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 lines/dashes etc. Remember, that the origin of the screen co-ordinates, as determined by Allegro, is different to that of the graph co-ordinates. The screen's origin is at the top-left corner, as illustrated in Figure 1.
Screen Co-ordinates
ELEN3009 Software Development II (8 pages page 6)
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Image Databases Towards Advanced Image Retrieval

Authors: Yihong Gong

1st Edition

1461375037, 978-1461375036

More Books

Students also viewed these Databases questions