Due by the end of Tuesday, 26 January 2021
NOTE: the loop in the program ends the lines; draw just draws the arrow.
HINT: You can add more to a String in Java by using the += operator. To get the String you need for toString, you just need to add the correct number of "-" characters.Alternatively, there is a way to create the required String using a char[], Arrays.fill and String.valueOf.
I recommend using either 1, 2 and 3 as the three values, or -1, 0 and 1. When you're assigning values, try to think about which values would make your later programming easier.
Make sure that the output from Activity 1 is not changed! (That is, if the client doesn't say which end the arrow head is on, then it's on the RIGHT.)
You will need to update the draw and toString methods so that the arrows are drawn properly.
Add two more methods, pointsLeft and pointsRight, so the client can ask an arrow whether it points in that direction.
Here is where your earlier choices on constants might make your life a little easier (or harder).
Test your changes by activating the Activity 3 code in ArrowTest. Ensure that the output above is followed by:
Activate the code for Activity 4 and confirm that the output above is followed by:
NOTE: we will learn about try-catch blocks later in the term. You don't need to understand them right now.
Submit this/these files:
You will be graded on the following: