Exercise 9. and 10. (the deadline is 30.04.2014)
Completion requirements
Exercise 9
Download file map.zip from here. This zip file consists of the following two files :
- Map.java
- mountains.map (It describes a surface map with the size the 201x201 . It specifies an altitude value (byte) value for each point of the map.
- mountains.map (It describes a surface map with the size the 201x201 . It specifies an altitude value (byte) value for each point of the map.
| Your job is to implement the method readMapFromFile() of the class Map which should read the given altitude (byte) values from file mountains.map into the predefined array map[] (Attention! It is a vector, not a matrix). If you do the right job you should see the following window on the screen after you run the class Map . |
Exercise 10
Recall the stack framework of Exercise 6 :
• Modify the interface Stack (introduce a generic type parameter), such that a stack which implements this interface will be able to store any kind of data.
• Modify the original abstract class AbstractStack and class BoundedStack such that they implement the new generic Stack interface.
• Test the new generic stack implementation with different data types (e.g.: int, double, String,… at least with two different types).
Last modified: Wednesday, 2 April 2014, 3:19 PM