Programming 1, fall 2007 -- Demonstration 6

Where I want everybody to be after demonstration 5:

Demonstration 6 happened in the computer class Asia, where I was able to show you how programming can be done by first making some test cases for a method, and then gradually making the method perform as it should. You always make a very small change at a time, and before you get lost, you try to compile and run your program to see whether it gives correct return values for the given parameters.

It is important to learn how the computation operations happen one at a time, and what it means to invoke a method. We used the following tool in the computer class. You can try it out for small programs yourself:

This time there were no exercises; I hope you have been reading your textbooks, and trying to understand programming by yourselves, though.