Creating Objects

Chapter: Objects and Classes
...Section: Creating Objects

If the preceding sections are clear, then the creation of class instances such as aPoint and abPoint should be straightforward. To summarize:


Exercise 2

Add the following type and range checks: Remember to make your error and range checking user-friendly. Rather than just crashing or producing incorrect results, your program should alert the user to the kind of input that is required, and then provide an opportunity for re-entry of the data.


rhyspj@gwu.edu