PiJ 2023/24 code samples
The usual note of caution applies: please look at the answers to exercises from the worksheets only after you have made a serious attempt at solution these exercises yourself.
When you look at the answers to exercises, please keep in mind that for a given programming exercise, there are usually many equally valid solutions. Thus, only because your code looks different, this does not mean that it is wrong.
Note: We have attempted to provide answers to worksheets using only the concepts covered in the module by the corresponding day. As such, the resulting code may not be ideal Java code, but it tries to provide answers that make sense without having to look ahead in the notes.