|
Mini Project: February 19 - March 5, 2004
The mini project is a mandatory programming project that must be completed by all
students taking "Java for Mobile Devices" (JPMA/JMA) for credit.
The details of the project (this text) are announced on February 19, and the
solution must be turned in on March 5 (before 12:00).
Solutions must be
turned in electronically by e-mail to Jørgen Staunstrup (jst@itu.dk).
When a
solution is received the sender will get an electronic receipt via e-mail that
the solution has been received. You should not consider the
project as handed in until this receipt has been received. The solution must be approved in order
to get credit for the course.
The project should be solved in groups of two persons. All participants must (be in a group that)
turn in a solution. Remember to write the names and e-mail addresses of both
participants in the group on the solution you turn in.
Project description
Create a MIDlet in J2ME for displaying a graph. The graph is defined by a vector
of integers (type "int") determining the y-values of the graph.
public class Plot ... {
public Plot(String title, int[] y) {
}
}
The index of the array y corresponds to the x-value of the graph, i.e. y[x]
is the value of the graph for x.
The method Plot must draw a graph on the display.
The graph is constructed from line segments connecting the y-values between adjacent x-values
(adjacent indices in the array).
It is recommended that the solution is made in these five steps:
- Program the method
Plot so it can draw a graph of a vector y with a length
that is smaller than the width (number of pixels) of the display and where the y values are in the range
0..Height (where Height is the height of the display in pixels). For steps 1-4 you may initialize y with
a set of values given in the source program (through initialization or assignments).
- Extend the solution from step 1 so the y values can be of arbitrary size and possibly negative.
- Extend the solution from step 1 so the length of the vector y can be much smaller and much larger
than the width (number of pixels) of the display. Combine the solutions made for steps 2 and 3.
- Extend the solution from step 1, 2, and 3 with a user interface that includes a zoom-function that makes it
possible to show only a part of the graph. As a minimum your solution must be able to display a subarray
between two indices xmin and xmax of y i.e. the y-values in
y[xmin..xmax].
- Extend your solution with an input method that can read the values of y from an external file.
Hint: use the skeleton of the Java method presented in the lecture on February 19.
Requirements to the solution
A solution to the mini project consists of the complete Java source code needed for
compiling and running the solution with the J2ME Wireless Toolkit (version 2.1). No
separate project report is required. Explanatory text must be included in the
source file as comments.
On Monday March 1, two arrays of test values (y-values) will be published
on the course web-site (http://www.itu.dk/courses/JPMA/F2004/index.html) and
news group (it-c.courses.JPMA).
They are availabale here.
It must be demonstrated that your solution
(MIDlet) is able to handle these two testcases.
Course organizor: Jørgen Staunstrup e-mail
You may send e-mail to all particpants by clicking
here
|
| |
|
 |