hi coderselite,
meine Aufgabe... wer lust und Zeit hat, kann mir ja mal unter die Arme greifen.
Erklärungen wären für mich vorteilhaft, da ich mit dem Thema Java nicht so wirklich klarkomme.
thx!
So wie ich das verstanden habe, soll ich eine main class erstellen, die diese methoden benutzen kann.
The class IntList is an implementation of the abstract data structure "list" for integer values.
Implement the class IntList according to the following specification:
IntList (int maxlength) // Maxlength is the maximum number of elements in the list
void append (int value) // Value is appended to the list (becomes the last element in the list).
void clear () // All elements are deleted from the list.
void copyTo (IntList list) // the elements are copied to list
void copyFrom (IntList list) // the elements are copied from list
void copyList (IntList List1, IntList list2) // The elements in list1 are copied to list2.
void delete (int index) // The element at index is removed (deleted) from the list.
void display () // The elements in the list are displayed.
boolean equals (IntList list) // The elements are compared to the elements in list.
int get (int index) // The element at index is returned.
int getCount () // The current count (number of elements) is returned.
void insert (int value, int index) // Value is inserted at index.
void put (int value, int index) // Value is put into the list at index (the old value at index is overwritten).
void sort () // The elements are sorted.
You should handle any errors by displaying an appropriate message (use System.out.println).
Implement a program to test the class. Be sure to test at the limits, for example, lists with just one element or inserting the last element. Each method of the class IntList should be tested by a dedicated method. Be sure to test your error handling.
During implementation you may notice issues not mentioned in the above specification. Solve these isssues as you see fit and be prepared to defend your decisions.
meine Aufgabe... wer lust und Zeit hat, kann mir ja mal unter die Arme greifen.
Erklärungen wären für mich vorteilhaft, da ich mit dem Thema Java nicht so wirklich klarkomme.
thx!
So wie ich das verstanden habe, soll ich eine main class erstellen, die diese methoden benutzen kann.
The class IntList is an implementation of the abstract data structure "list" for integer values.
Implement the class IntList according to the following specification:
IntList (int maxlength) // Maxlength is the maximum number of elements in the list
void append (int value) // Value is appended to the list (becomes the last element in the list).
void clear () // All elements are deleted from the list.
void copyTo (IntList list) // the elements are copied to list
void copyFrom (IntList list) // the elements are copied from list
void copyList (IntList List1, IntList list2) // The elements in list1 are copied to list2.
void delete (int index) // The element at index is removed (deleted) from the list.
void display () // The elements in the list are displayed.
boolean equals (IntList list) // The elements are compared to the elements in list.
int get (int index) // The element at index is returned.
int getCount () // The current count (number of elements) is returned.
void insert (int value, int index) // Value is inserted at index.
void put (int value, int index) // Value is put into the list at index (the old value at index is overwritten).
void sort () // The elements are sorted.
You should handle any errors by displaying an appropriate message (use System.out.println).
Implement a program to test the class. Be sure to test at the limits, for example, lists with just one element or inserting the last element. Each method of the class IntList should be tested by a dedicated method. Be sure to test your error handling.
During implementation you may notice issues not mentioned in the above specification. Solve these isssues as you see fit and be prepared to defend your decisions.