| Computer Laboratory Course material 2008–09 |
Programming in Java
|
![]() | ![]() |
| Andrew Rice | Alastair Beresford |
Click here to see all the submissions
Click here for a description of how each submission works
Remember to submit work by Wednesday at 5pm on the week following the practical class; submission instructions are contained in the workbook for the week.
The workbook for each practical class will appear here just prior to the start of the practical session.
Please complete the following questionnaires after you have completed the associated workbook and tick. You should print out questionnaire, fill in the appropriate fields and hand it in to your ticker at the next ticking session.
The printed workbooks contain (at the very least!) the following errors. Errors are indexed by workbook (W), page (P) and line (L), which may be negative, indicating that the reader should count upwards from the bottom of the page. These errors have been corrected in the on-line versions of the workbooks shown above. If you find any further errors, please email ticks1a-admin[at]cl.cam.ac.uk.
| W | P | L | Errata | Corrige | From |
|---|---|---|---|---|---|
| 1 | 1 | 3-4 | This course relies heavily on the material taught in Software Design and Programming Methods and these courses are lectured concurrently with this course. | This course relies heavily on the material taught concurrently in Software Design and Programming Methods. | fhk1 |
| 1 | 5 | 24-26 | The option for printing "AM" or "PM" does not work on PWF machines | An answer which does not display "AM" or "PM" on the PWF workstations is permissible. | gh323 |
| 1 | 8 | 8 | "String args[]" | A better form is "String[] args" | acr31 |
| 1 | 8 | 25 | "String args[]" | A better form is "String[] args" | acr31 |
| 1 | 8 | 27 | "String args[]" | A better form is "String[] args" | acr31 |
| 1 | 10 | 18 | "String args[]" | A better form is "String[] args" | acr31 |
| 1 | 12 | 14 | crsid-1.jar | crsid-tick1.jar | mjac4 |
| 1 | 12 | 22,30 | arb33-1.jar | arb33-tick1.jar | mjac4 |
| 2 | 4 | 20 | Java does not round up | Java rounds towards zero | jrb95 |
| 2 | 7 | -8 | the 8-bit binary number 1001100 | the 8-bit binary number 10001100 | sgb35 |
| 2 | 10 | 4 | 2 != (!(12 == 3)) | true != (!(12 == 3)) | ha293 |
| 2 | 11 | 12 | The valid range for the position variable is unclear. | Add the comment "position counts from zero (representing the least significant bit) up to 63 (representing the most significant bit)" | acr31 |
| 2 | 9 | 8 | boolean t4 = t1 | t2 & t3; //false | boolean t4 = t1 | t2 & t3; //true | iv228 |
| 2 | 11 | -6 | new Long(args[0]).longValue() | Long.decode(args[0]) | ljg39 |
| 2 | 11 | 5 | Long.parseLong(args[0]) | Long.decode(args[0]) | ljg39 |
| 3 | 2 | 10 | v = PackedLong.set(v,i) | v = PackedLong.set(v,i,val) | jkm47 |
| 3 | 7 | 5-6 | The method should return the updated version of method at the end of the method body. | The method should return the updated version of world at the end of the method body. | crh55 |
| 3 | 7 | 3,7,12 | getNeighbours | countNeighbours | ha293, jrb95 |
| 3 | 11 | -5 | uk.ac.cam.crsid.TinyLife | uk.ac.cam.crsid.tick3.TinyLife | jrb95 |
| 3* | 1 | -12 | myArray[i] = 1000; | myArray[i] = 1000L; | jrb95 |
| 3* | 2 | 5 | Missing a class file in the list of contents of the jar file | uk/ac/cam/crsid/tick3star/PackedLong.class | jrb95 |
| 4 | 2 | 6 | intArray[2] = intArray[2] + 7; | intArray[2] = intArray[0] + 7; | prc33 |
| 4 | 2 | 8 | package | package* | prc33 |
| 4 | 2 | -15 | Insufficient examples for the method store | Include the following examples in the comments: store(0) should store nothing; and store(6) should store 1,1,2,3,5,8 in first six elements of fib | acr31 |
| 4 | 4 | -7 | Figure 1 labels three cells as j[2][1] | Each cell is unique in the diagram; the second and third cells labelled j[2][1] should be labelled j[2][2] and j[2][3] respectively. | djm208 |
| 4 | 4 | -7 | Figure 1 labels two cells as j[1][1] | Each cell is unique in the diagram; the second cell labelled j[1][1] should be labelled j[1][2]. | arb33 |
| 4 | 5 | -7 | Notice that none of the methods now return an updated version of world | Notice that setCell does not return an updated version of world. | mb566 |
| 4 | 7 | -6 | this storage space is called a field if appears inside the body | this storage space is called a field if it appears inside the body | dr336 |
| 4 | 8 | 18 | Packedlong.set | PackedLong.set | dr336 |
| 4 | 9 | 11 | "The University of Cambridge is "+800+"years old" | "The University of Cambridge is "+800+" years old" | jrb95 |
| 4 | 10 | 17 | (0,1), (1,2), (2,0), (2,1) | (1,0), (2,1), (0,2), (1,2) | oc243 |
| 4 | 10 | 19 | (1,2), (2,3), (3,1), (3,2) | (2,1), (3,2), (1,3), (2,3) | oc243 |
| 4 | 12 | 19 | private int startX | private int startX; | jrb95 |
| 4 | 13 | -7 | Missing PackedLong in the jar file | Need uk/ac/cam/crsid/tick4/PackedLong.java and uk/ac/cam/crsid/tick4/PackedLong.class | jrb95 |
| 5 | 1 | -5 | a method call from line 96 of PatternLife.java | the constructor on line 96 of PatternLife.java | jrb95 |
| 5 | 3 | -2 | until an enclosing try-catch block is found | until an enclosing try-catch block is found which catches an exception of the correct type | jrb95 |
| 5 | 3 | 14 | should return "one one one" | should return "one one one". Adjacent copies of the repeated string should be separated by a single space. | drt24 |
| 5 | 3 | -14 | uk.ac.cam.crsid.Repeat | uk.ac.cam.crsid.tick5.Repeat | drt24 |
| 5 | 7 | -13 | two letter string "\r\n" | two character string "\r\n" | jrb95 |
| 5 | 9 | 9,14,27 | uk.ac.cam.crsid.LoaderLife | uk.ac.cam.crisd.tick5.LoaderLife | jrb95 |
| 5 | 10 | -2 | without unpacking the jar file | without explicitly specifying a class to execute | jrb95 |
| 5* | 1 | -17 | the growth rate is 2.0 | the growth rate is 1.0 | ls475 |
| 6 | 8 | 1 | String first = "a"; | String first = new String("a"); | jrb95 |
| 6 | 8 | 2 | String second = "a"; | String second = new String("a"); | jrb95 |
| 6 | 8 | -9 | --packed | --long | sh580 |
| 6 | 8 | -7 | System.exit(1); | return; | acr31 |
| 6 | 10 | 21 | public void World nextGeneration(int log2StepSize) | public World nextGeneration(int log2StepSize) | oc243 |
| 6 | 10-12 | various | ImplWorld | WorldImpl | spe24 |
| 7 | 2 | 5 | inheritence | inheritance | arb33 |
| 7 | 4 | -9 | STRINGS.PANEL_SOURCE | Strings.PANEL_SOURCE | vv236 |
| 7 | 4 | 8 | Missing import statement | import javax.swing.JScrollPane | lr331 |
| 7 | 5 | -5 | only only | only | ia264 |
| 7 | 6 | 27 | superclass | super class | arb33 |
| 7 | 11 | 18 | preceeding | previous | arb33 |
| 7 | 12 | 10 | inherts | inherits | arb33 |
| 7 | 12 | -15 | char userResponse = 0; | int userResponse = 0; | oc243 |
| 7 | 13 | various | uk/ac/cam/crsid/TickLife | uk/ac/cam/crsid/tick7/TextLife | drt24 |
| 7 | 14 | 1 | Missing hint in optional work | Extra hint | acr31 |
| 7 | 14 | 6 | Tick 6 | Tick 7 | rhm31 |
| 8 | 2 | 12 | class which is handles | class which handles | lr331 |
| 8 | 3 | 17 | the two classes to work | the two classes work | ta299 |
| 8 | 6 | 18 | Numbering of exercises repeats | This block of exercises should be numbered from 3 | ia264 |
| 8 | 6 | 18 | the second version of HelloActionWorld | HelloActionWorld2 | lr331 |
| 8 | 6 | 22 | by deleted the field | by deleting the field | vv236 |
| 8 | 7 | -10 | Extra hint | Hint: since playTimer is not a static field, you will need to access the field from the instance of GuiLife you have already created called gui | vv236 |
| 8 | 8 | -8 | Extra hint | Hint: You'll need to import ChangeListener and ChangeEvent | vv236 |
| 8 | 13 | -11 | Its very slow | It's very slow | jn283 |