README
See Also
- https://en.wikipedia.org/wiki/Shoelace_formula (area of a polygon)
- https://en.wikipedia.org/wiki/Heron%27s_formula (area of a triangle)
- https://en.wikipedia.org/wiki/Distance#Geometry (distance between two points)
Code
Q&A
Notes
Exercises
- Study the source code for the
ShoestringMath class, including the associated Javadoc comments.
Then study the source code for each of the following classes.
Study the sample solution for the Path class, then create documentation and automated tests for the other classes listed above as follows.
- Create Javadoc comments for each of the classes and for all of the public methods of the classes that do not already have Javadoc comments.
- For each of the classes that do not already have a main method, add a
main
method to the class. - Implement each main method so that it tests whether the other public methods of the class function as intended. (Make sure you understand how the methods are supposed to work!)
- Create Javadoc comments for each of the main methods that you create.
- Try to improve the sample solution for the Path class.
- Try organizing your code for the classes listed above in a single file and in multiple files.
- Compile your code by placing the code for all classes in a file named
ShoestringMath.java
. Execute each of your main methods. - Make each of the classes
public
and put the code for each class in its own file. Save the files in a common directory. Compile the code and execute each of your main methods.
- Compile your code by placing the code for all classes in a file named
- Finish implementing the methods that are missing code.
- Use the
main
methods you implemented in the previous exercise to test your implementations, and/or... - Start with the Bugger (a gradable buggy program) code listing,
fix the bugs int that code, and verify that all the tests defined in the
Grader
class pass. - Test your code using other sets of inputs (command-line arguments). What problems, if any, did you discover?
- Use the