[an error occurred while processing this directive]
A More Robust Digitsum
The Task
Read in a number from the keyboard, making sure that it is a positive
integer, and add up the digit's it contains.
The Program
[an error occurred while processing this directive]
The Sample Run
[an error occurred while processing this directive]
The Lesson
- Robustness is a property of programs
- Think about the assumptions you are making about your inputs.
- Check your inputs to make sure they meet the assumptions
[an error occurred while processing this directive]
Saturday, 15-Feb-1997 13:27:06 EST