![]() |
![]() |
|
home—info—lectures—exams—hws—archive
Review:
We saw 'Book', and method
A function book -> book; immutable.
vandalize : book -> book (half the #pages, and blend the title/author)
How do test-cases look in Java? S.o.p( ... )
Btw: write this as a static method, or not?
How are they related?
Discuss: superficially rewrite any ITEC120 java program
so that it's static. `this` as an implicit parameter.
Types as sets.
compare math's function notation w/ our signatures.
Ways to combine types:
x
U [to be seen]
For each type of data involved:
1. Data Definition (how will you represent an age, a gender, a book, etc.)
2. Examples of the Data (trivial first)
Then, for each function involving that data:
3. description, signature, and header/stub
4. test cases
5a.
case analysis
5b. selectors (what is the type of each?)
5c. add any natural/pertinent function calls on these pieces
5d. assemble the parts of 5b.
6. Run tests.
home—info—lectures—exams—hws—archive
| ©2009, Ian Barland, Radford University Last modified 2009.Sep.16 (Wed) |
Please mail any suggestions (incl. typos, broken links) to ibarland |
![]() |