From PLSwiki

Jump to: navigation, search


Object-oriented Programming, Introduction (OPI), Fall 2008

This is the course page for Object-Oriented Programming, Introduction.

Practical and administrative matters

  • Newsgroup: see below.
  • NOTE: first week (Mon 25 Aug + Wed 27 Aug) lectures are 16:00 - 18:00 and three are no labs. Mon 25 Aug and Wed 27 Aug we are in 3A 12.
  • Lectures: Monday 13:30-15:30 (3A 12), Wednesday 13:30-15:30 (3A 12).
  • Exercise labs: Monday 16-18 (Rooms 3A 50 + 3A 52), Wednesday 16:00-18:30 (Rooms 3A 50 + 3A 52).
  • The course period is 16 weeks half time (15 ects). The course will consist of approximately 12 weeks of lectures and four weeks project work.
  • 13 out of 15 mandatory exercises must be handed and passed satisfactorily to attend the exam. The project work counts for 4 mandatory exercises (so you must hand in the project work to attend the exam). You are allowed to work in groups to solve the excercises, but each individual student must write his/her solution up individually and hand it in by him/herself.
  • Students are expected to attend the lectures and make use of the labs.
  • Exam: 4 hours written exam, paper and pencil, date 2009-01-08.
  • Last years exam can be found [here] and [here]

Topics and tentative plan

  • Below is a tentative plan.

Week Date Teacher Topic Materials Labs
35 Mon 25 Aug LB Intro + Blue J ch. 1

[slides], [HelloPrinter.java]

No labs
35 Wed 27 Aug JT Using Objects ch. 2 (- 2.8, 2.11, 2.12, 2.13)

[slides], [examples]

No labs
36 Mon 01 Sep JT Impl. Classes ch. 3 (- 3.6, 3.9)

[slides], [examples]

Exercises: P1.1, P1.5, P1.6, R2.3, R2.5, P2.3, P2.4, P2.10
36 Wed 03 Sep JT Data Types ch. 4

[slides], [lecture example], [examples]

Exercises: R3.5, R3.6, R3.8, P3.1, P3.2, P3.3, P3.4, P3.6, P3.11
37 Mon 08 Sep JT Decisions ch. 5 (- 5.5)

[slides], [lecture example], [examples]

Exercises: R4.4, R4.6, R4.8, P4.1, P4.4, P4.6, P4.11, P4.14, R4.9, R4.11, R4.16, R4.13,
37 Wed 10 Sep JT Iteration ch. 6 (- 6.5, 6.6, 6.7)

[slides], [lecture example], [examples]

Exercises: P5.2, P5.3, P5.8, P5.9, R5.1, R5.6, R5.8, R5.13,
38 Mon 15 Sep JT Array and Array Lists ch. 7 (- 7.8)

[slides], [lecture example], [examples]

Exercises: R6.2, R6.3, R6.5, P6.2, P6.4, P6.5, P6.7, P6.8
38 Wed 17 Sep JT Order-a-lecture: We'll revisit troubled spots from the first 6 lectures according to popular demand. So please let me know what you would like to see. Also QUIZ with spectacular prize! Math.round and rounding errors. Lifetime and scope of variables. Objects and object references. A look at the main method. Exercises: catch up with earlier exercises
39 Mon 22 Sep JT Recursion ch. 13

[slides], [examples]

Exercises: R7.1, R7.2, R7.3, R7.4, R7.11, R7.17, P7.1, P7.2, P7.3, P7.4, P7.5, P7.6
39 Wed 24 Sep JT Sorting ch. 14: 14.1 - 14.5


Exercises: R13.2, R13.4, R13.8, P13.1, P13.4, P13.6, P13.7, P13.13
40 Mon 29 Sep LB Searching ch. 14: 14.6 - 14:8

[slides] [examples]

Exercises: P14.1, P14.3, P14.4, P14.12, P14.13, P14.14
40 Wed 01 Oct LB Data Structures Intro ch. 15

[slides] [examples]

Exercises: continue with the earlier ones
41 Mon 06 Oct LB Generics ch. 17 (- advanced topic 17.1)

[slides] [examples]

Exercises: R15.1, R15.2, R15.3, R15.4, R15.5, R15.8, P15.2, P15.4, P15.5, P15.11, P15.14
41 Wed 08 Oct LB Review


Exercises: continue with the earlier ones
43 Mon 20 Oct LB Designing Classes ch. 8 (- 8.10)

[slides] [examples]

Exercises: R17.1, R17.2, R17.3, P17.1, P17.2, P17.3, P17.7, P17.8
43 Wed 22 Oct LB Interfaces ch. 9 (- 9.5)

[slides] [examples]

Exercises: R8.1, R8.4, R8.19, P8.1, P8.2, P8.3, P8.5, P8.8, P8.11
44 Mon 27 Oct CS Inner Classes ch. 9 (9.6)

[slides] [examples]

Exercises: R9.3, P9.5, P9.6, P9.7
44 Wed 29 Oct CS Inheritance ch. 10 (- 10.9, 10.10, 10.11)

[slides] [examples] [super.super]

Exercises: R9.13, R9.18, P9.13, P9.16
45 Mon 03 Nov CS Exceptions ch. 11

[slides] [examples]

Exercises: R10.3, R10.4, R10.8, P10.4, P10.5
45 Wed 05 Nov AB Graphics 2.11, 2.12, 2.13, 3.9, 9.6-9.10, 10.9-10.11

[slides] [slides(6-per-page)] [Example removing an Inner Class]

Exercises: R11.8, R11.15, R11.19, P11.4, P11.7, P11.11
46 Mon 10 Nov CS Object-Oriented Design ch. 12

[slides] [examples]

Exercises: R2.11, P2.13, P3.18, R9.22*(optional), P9.21, R10.18, P10.16, P10.17
46 Wed 12 Nov CS Threads ch. 20

[slides from class] [book slides] [book examples]

Exercises: catch up
47 Mon 17 Nov CS Graphics ch. 18

[slides] [examples]

Exercises: R20.2, R 20.8, P20.1, P20.4, P20.7
47 Wed 19 Nov CS Class Invariants and Contracts

[Betrand Meyer. Design by contract.] [Slides.] [Gary T. Leavens and Yoonsik Cheon. Design by Contract with JML.]

Exercises: R18.3, R18.14, P18.1, P18.3, P18.7, P18.9
48 Mon 24 Nov AB Project (Othello) see below Project
49 Mon 01 Dec AB Project (Othello) see below Assignment 1 (Board structure)
50 Mon 08 Dec AB Project (Othello) see below Assignment 2 (Human Player)
51 Wed 17 Dec AB Project tournament, at the scroll bar at 14:30 Assignment 3 (Computer Player)

Research Paper


The project is about implementing an Othello program (also known as Reversi). The official page of the project, with the latest versions of all the material, is there. You can also access directly the project description and the code base or code zipped or jar file.

There won't be a meeting on Monday 15th, but instead a tournament with the artificial players in the scroll bar at 14:30 on Wednesday 17th of December.


There is a newsgroup for this course, where students can post and answer questions to each other. The teaching assistent will also read and answer questions once or twice every week. You can subscribe via your email program (for example Mozilla Mail), there is a folder called news.itu.dk, and the newsgroup is called it-c.courses.SOPI.

Literature and materials

  • Cay Horstmann: Big Java, 3rd Ed., Wiley

Exercise Labs

At the exercise labs you should work on solving problems from the course material and ask questions to the teaching assistant.

Mandatory Assignments

You should hand-in the mandatory assignments by 13:30 in the pidgeon hole outside wing 1C on Mondays, according to the plan below. Assignments are handed in on paper. You don't have to typeset your answers, but you should have tested all the code you submit. The hand-in should contain: a title page with the name of the course, and your name and a “report” with comments to your solution and program code. All pages including the title page should be stabled together. The assignment will be evaluated as either pass or fail. If it fails, you need to hand in a description on what did not work in the code and show an example of how you could make it work, this needs to be done within one week (otherwise if in doubt ask the Teacher assistant).

Tentative Plan:

  • 1. Hand-in on Wednesday Sep 03 at 18:30: P2.3 (either in pidgeon hole or directly to Marcus at exercise labs)
  • 2. Hand-in on Monday Sep. 08 at 13:30: P3.6, P4.11
  • 3. Hand-in on Monday Sep. 15 at 13:30: P5.9, P6.4
  • 4. Hand-in on Monday Sep. 22 at 13:30: R7.3, P7.3
  • 5. Hand-in on Monday Sep. 29 at 13:30: P13.4, P14.13
  • 6. Hand-in on Monday Oct. 06 at 13:30: R15.5, P15.2
  • 7. Hand-in on Monday Oct. 20 at 13:30: R17.9, P17.3
  • 8. Hand-in on Monday Oct. 27 at 13:30: R8.19, P8.8
  • 9. Hand-in on Monday Nov. 03 at 13:30: R9.13, P9.16
  • 10. Hand-in on Monday Nov. 10 at 13:30: R10.4, P10.4
  • 11. Hand-in on Monday Nov. 17 at 13:30: R20.8, P20.1
  • 12. Hand-in on Monday Nov. 24 at 13:30: R11.15, P18.9
  • 13. Hand-in on Sunday Nov. 30 at 23:59: Part 1 of Othello
  • 14. Hand-in on Sunday Dec. 07 at 23:59: Part 2 of Othello
  • 15. Hand-in on Sunday Dec. 14 at 23:59: Part 3 of Othello


Teaching Assistant

  • Marcus Overheu (maov@itu.dk)

Comments for exercises in Object-oriented programming

Every week there will be comments about the most common errors, these can be seen [here].

Personal tools