Introduction to Programming

Deutsche Version dieser Seite

Bertrand Meyer, fall semester 2009

General: news | reading assignments | course description | course book | helping and getting help | downloads | further reading
Lecture: schedule | slides and video recordings
Exercises: groups | exercise sheets | exercise slides



9.8.2010   The exam will take place in HIL G15 from 14:00 to 16:00.
21.12.2009   The master solution of assignment 10 is now online.
14.12.2009   The second mock exam and its master solution are now online.
4.12.2009   The master solution of assignment 9 is now online.
1.12.2009   Further info about the project assignment: you are allowed to work both individually or in a team of up to 2 people. For those who wish to deliver more, there will be extensions to the deadline of December 18th. In January, we will be contacting you asking if you are willing to showcase your work at the beginning of the next semester.
27.11.2009   Assignment 10 is now online.
26.11.2009   The master solution of assignment 8 is now online.
24.11.2009   Announcement: The second mock exam will take place on December 7th and 8th, according to your exercise group schedule.
23.11.2009   The course evaluation will take place on December 1st.
22.11.2009   Assignment 9 is now online.
15.11.2009   Solution to assignment 7 is now online.
15.11.2009   The first mock exam is now online.
12.11.2009   Assignment 8 is now online.
5.11.2009   Solution to assignment 6 is now online.
30.10.2009   Assignment 7 is now online.
28.10.2009   Announcement: the first mock exam will take place during the exercise session in two weeks (for the Monday groups: November 9, 15:00-17:00; for the Tuesday groups: November 10, 13:00-15:00). The place is your regular exercise rooms except for the groups Hoare and Wirth that both should go to HG E21. Your presence at the Mock exam is required for the Testat. If you have a justifiable reason for not coming, please, contact Nadia Polikarpova in advance.
28.10.2009   Solution to assignment 5 is now online.
24.10.2009   Assignment 6 is now online.
21.10.2009   Solution to assignment 4 is now online.
17.10.2009   Assignment 5 is online.
15.10.2009   Solution of assignment 3 is online.
10.10.2009   Assignment 4 and solution of assignment 2 are online.
5.10.2009   If you still don't have an exercise group, please contact Nadia Polikarpova, specifying your experience level (A: begineer, B: intermediate, C: advanced), your preferred language (German or English) your preferred day (Monday or Tuesday). The groups with available seats are Nygaard, Hoare, Wirth, Dijkstra, Liskov and Knuth.
2.10.2009   Assignment 3 is online.
1.10.2009   You can now use all the computer rooms: CAB E38, IFW D31, IFW C31, CAB E31 and CAB E37.
28.9.2009   Second assignment is online.
24.9.2009   If you haven't fill in the self-assessment questionnaire and you would like to be assigned to an exercise group, please contact Nadia Polikarpova, specifying your experience level (A: begineer, B: intermediate, C: advanced), your preferred language (German or English) and your preferred day (Monday or Tuesday).
23.9.2009   The Goldberg exercise session on Tuesday by Alexander will be moved from room ETZ K91 to HG E22 starting from Tuesday, 29.09.09.
22.9.2009   Please don't use computer rooms CAB E38 and IFW D31. We are fixing some issues on some of the PC's there. We will let you know when they are ok. You can still use IFW C31, CAB E31 and CAB E37.
21.9.2009   First assignment is online.
20.6.2009   First version of webpage.

Reading assignments

  • Touch of Class, Chapter 19
  • Touch of Class, Chapter 17 and 18
  • Touch of Class, Chapter 11 and 18
  • Touch of Class, Chapter 15
  • Touch of Class, Chapter 13
  • Touch of Class, Chapter 14
  • Touch of Class, Chapter 16
  • Touch of Class, Chapter 8
  • Touch of Class, Chapter 7 and 9
  • Touch of Class, Chapter 5 and 6
  • Touch of Class, Chapter 3 and 4
  • Touch of Class, Chapter 1 and 2
  • Information for students

Course description

Title and ID

Introduction to Programming
ID (Vorlesungsnummer): 252-0021-00


  • Foundations of object-oriented programming
  • Objects and classes
  • Interface of a class
  • Design by Contract, preconditions, postconditions, class invariants
  • Basic control structures
  • Assignment and referencing
  • Basic knowledge about the hardware
  • Basic data structures and algorithms
  • Recursion
  • Inheritance and deferred classes
  • Introduction to event-driven and concurrent programming
  • Fundamental concepts of software engineering: software production process, specification, documentation, reuse, quality assurance

Course book

Bertrand Meyer: Touch of Class, Learning to Program Well with Objects and Contracts, Springer 2009, ISBN: 978-3-540-92144-8. Electronic version (only available inside ETH network)

Helping and getting help

If you think you are having issues with the Traffic software, first check if it is a known bug and if there are already workarounds published. Then share your thoughts with an assistant, and possibly submit a bug report. You can also use the help forum to ask course- and exercise-related questions. The assistants will do their best to answer your questions as soon as possible.


The precise description of which software is needed and how to install it can be found on the first exercise sheet. The lecture slides (in .ppt and pdf format), the exercise session slides, the exercise sheets, the masters solutions for the exercises and the mock exams can be downloaded from this page.

Further reading

  • Bertrand Meyer: Object-Oriented Software Construction, Second Edition, Prentice Hall, ISBN 0-13-629155-4
  • Pete Thomas, Ray Weedon: Object-Oriented Programming in Eiffel, Second Edition, Addison-Wesley Eiffel in Practice Series, ISBN 0-201-33131-4
  • Frieder Monninger: Eiffel. Objektorientiertes Programmieren in der Praxis, H. Heise Verlag, Hannover, ISBN 3-882-29028-5
  • Bertrand Meyer: La produzione del software object oriented. Prentice Hall International, Hemel Hempstead, ISBN 88-256-0205-7
  • Giuseppe Callegarin: Nuovo corso di informatica. Basi di dati e sistemi informativi. Per le Scuole superiori. CEDAM, ISBN 8-813-19565-6
  • The concept of information hiding was first documented by David Parnas in this paper.






Monday 13:00-15:00 HG E3  
Tuesday 8:00-10:00 HG F1  

 Slides and video recordings


Exercise Groups

The distribution of students in the exercise groups is based on an initial self assessment questionnaire. Students are then assigned to an exercise group according to their declared level of experience. Levels are: A (beginner), B (intermediate), C (experienced). If you haven't fill in the self-assessment questionnaire and you would like to be assigned to an exercise group, please contact Nadia Polikarpova, specifying your experience level, your preferred language (German or English), and the preferred day (Monday or Tuesday). The groups with available seats are Nygaard, Hoare, Wirth, Dijkstra, Liskov and Knuth.






Room and time


Experience Level

Michela Pedroni RZ J8 044 632 76 84 Michela Pedroni Nygaard Tue, 13:15-15:00, IFW A34 German A
Scott West RZ J8 044 632 74 09 Scott West Torvalds Tue, 13:15-15:00, LFW C5 English A
Marco Trudel RZ J9
044 632 85 92
Marco Trudel Lovelace Mon, 15:15-17:00, LFV E41 German
Nadia Polikarpova RZ J8
044 632 65 74
Nadia Polikarpova Hoare Tue, 13:15-15:00, IFW B42 English
Julian Tschannen RZ J3 044 632 44 49
Julian Tschannen Wirth Tue, 13:15-15:00, CAB H53 German C
Benjamin Morandi RZ J9 044 632 78 28 Benjamin Morandi Dijkstra Mon, 15:15-17:00, ML H41.1 German A
Nikolay Kazmin     Nikolay Kazmin Liskov Tue, 13:15-15:00, ETZ E9 English B
Florian Köhl     Florian Köhl  Knuth Tue, 13:15-15:00, CAB H52 German A
Alexandre Lagadec     Alexandre Lagadec Goldberg Tue, 13:15-15:00, HG E22 German B
Jeremie Miserez     Jeremie Miserez Turing Tue, 13:15-15:00, ETZ F91 German B

Assignments and mock exams

The weekly assignments will be checked by the assistants but not graded. The suggested way to submit the assignments is in electronic form (typically via email). The complete solutions of the assignments will be published after the due hand-in date. Students are strongly encouraged to look at the published master solutions and ask questions about the parts of the solutions that they don't understand. Common errors will be addressed and discussed during the exercise sessions. Within the semester two mock exams will take place during the exercise sessions. To get the testat and be able to take the final exam, students must do both the mock exams (grade is not relevant) and hand-in all but one assignment. The mock exams will be checked, graded and handed back to the students.




Master solution

Week 1 Getting started Sheet
Week 2 Give me your feature name and I'll call you Sheet Solution
Week 3 Of Objects and Features Sheet Solution
Week 4 Object creation Sheet Solution
Week 5 References and assignments Sheet Solution
Week 6 Loops and conditionals Sheet Solution Boardgame code
Week 7 More peachy loops Sheet Solution
Week 8 Mock exam 1 Sheet Solution
Week 9 Polymorphic Behaviors Sheet Solution Boardgame code (II)
Week 10 Recursion Sheet Solution Maze code
Week 11 Agents and boardgames Sheet Solution Boardgame code (III)
Week 12 Mock exam 2 Sheet Solution

Slides used in the exercise sessions

The slides used in the exercises are available here (note: in the pdf version animation is not retained and some slides can become unclear):
Date Material (.pdf) Material (.ppt)
22.09.2009 pdf pptx
29.09.2009 pdf pptx
6.10.2009 pdf pptx source
13.10.2009 pdf pptx
20.10.2009 pdf pptx
27.10.2009 pdf pptx
3.11.2009 pdf pptx
10.11.2009 mock exam
17.11.2009 mock exam sol.
24.11.2009 pdf pptx magic squares
1.12.2009 pdf pptx
8.12.2009 mock exam 2
15.12.2009 mock exam 2 sol.
Advanced material
Void safety pdf pptx demo
Once routines pdf pptx demo
Programming paradigms pdf pptx
CAT calls pdf pptx
Testing pdf pptx

Back-office assistant e-mail: Marco Piccioni