Two Dimensional Point Example
Initial Two Dimensional Point Example:
Augmented Two Dimensional Points:
- In this example, we want to make our 2D points "better." Specifically, we would like to add the following:
- Ability to initialize them with string values, e.g., twoDimPoint pt = "(2.12, 3.45)";
- Reading a twoDimPoint into a program "naturally" using cin
- Comparing two twoDimPoints for equality (or non-equality)
- Adding two points together.
- Giving the points a printable (i.e., character string) name.
- Augmented Versions
- Comparisons
- Original header file versus the augmented file (diff).
- Original source file versus the augmented file (diff).
- Original test program versus the augmented test program (diff).