In High School Math class, you would have learned about the Cartesian coordinate system. Computer science makes use of this system a lot as well, especially for rendering purposes. Normally, when we think about rendering any sort of graphic on the screen at a specific position, we start from the top-left corner of the screen. This is why by convention, the y-axis of the Cartesian coordinate system is flipped vertically, meaning that y-values increase as you move down the axis, and decrease as you move up. This can be seen below:
Your task is to study and understand the source code Map
, User
, and UnitTestMap
classes provided, and implement the methods in the Map
and User
classes according to their specifications in the descriptions/method headers, such that all the tests in the UnitTestMap
class pass. To run the tests, right-click the UnitTestMap.java
source/class file in the map
package of t3-map-assignment
project, hover over Run As
(next to green 'play' button), then click Java Application
. You should see the results of the tests printed in the Eclipse console. Whenever you are making changes to your code and running the tests to see if they are right, make sure you are saving the changes in Eclipse first before you run the tests, or you would be just running the tests based on the last time the source code was saved (i.e. before the changes you made). To get a better idea of what the users on the map would look like, refer to the image below: