Posted: Thu Nov 19
Due: Friday 11/20 10:00am
Submission name: w26_listarray
Improved Drawing
The main goal of this assignment is to take the program from work 25 and modify it form one that uses an array of PVector objects to one that uses a custom ListArray class as described in class:
classDiagram
class ListArray{
-PVector[] data
-int size
+ListArray()
+void add(PVector p)
+PVector get(int i)
+int getSize()
-void expand()
}
Some notes on ListArray:
- The constructor should make
dataa 100 element array. - If the parameter to
get()is invalid, returnnull. add()should always add to the end of the list.expand()should be called only when it is needed inadd().
In addition to ListArray, you will have to modify the driver file such that it works with a ListArray instead of an array.