Computer Science | CSE | AS 21

Course catalog: 252-0856-00L, 252-0856-AAL
Lecturers: Felix Friedrich, Ralf Sasse

Date Message
28.11.2021 Lecture on 29.11.2021 will take place ONLINE. You can find the Zoom link here.
24.09.2021 The Study Center will start on 1st of October. It will take place on each Friday from 14:15 till 16:00. You can find the Zoom link here.
Lectures Monday 08:15 -- 10:00 ML E 12, Livestream on the video portal
Exercises Tuesday 13:45 -- 15:30 Hönggerberg
Tuesday 16:15 -- 18:00 Zentrum
Wednesday 10:15 -- 12:00 Zentrum
Wednesday 16:15 -- 18:00 Zentrum

The (German spoken) lectures are recorded. Videos will be made available at ETH's video portal, on the direct link (only works after first lecture).

Lecture Chat

We enjoyed the extra interaction via the Zoom chat during online teaching, and we'll now try to integrate a chat in to our lectures. The link can be found here . Potentially good to know:

  • Optional: Participation is optional, and crucial information will always be announced elsewhere
  • Not anonymous: You can change your display name, but your ETH username can be seen on hover
  • Transient: Messages can be deleted, and we plan to delete all messages once the course is over (or even after each lecture)
  • Open: If you don't like the web client, get the official app, or use alternative clients
Please use the chat responsibly, and help us (ideas? feedback?) to make this a successful experiment for all of us.

This is a plan. No plan survives contact with reality. We will constantly update lecture material before the lectures.

Week Date Topic Lecture Additional Material Exercises
1 Wed 22.09. FF/RS: Introduction, First C++ Program Organisation [de] [en]
Overlays [de] [en]
Handout [de] [en]
Lecture Video available on Video portal.
C++ Playground
Program Tracing
C++ style guide
Summary 01
Exercise Registration
C++ Tutorial
Organisational Information
Exercise 1 (PDF)
Exercise session slides (de)
Exercise session slides (en)
2 Mon 27.09. FF: Integer Arithmetic and its Limits Overlays [de] [en]
Handout [de] [en]
Ariane 5 Video ❘ Details
Clicker: Ausdruckswert
Summary 02
Exercise 2 (PDF)
Self-Assessment I (Solutions: Even Numbers I, Even Numbers II)
3 Mon 04.10. FF: Boolean Functions, Safe Programming, Control Flow I Overlays [de] [en]
Handout [de] [en]
Code Example: Mixed Integer Expressions
Code Example: Div-Mod Identity
Code Example: GCD
Code Example: De Morgan
Code Example: Sum First n Numbers
Code Example: IsPrime
Clicker: Mixed Int. Expr.
Clicker: For Loop
Summary 03
Assert Slides
For Loop Slides
Exercise 3 (PDF)
4 Mon 11.10. RS: Control Flow II, Floating Point I Overlays [de] [en]
Handout [de] [en]
Lecture Code Examples
Clicker: for-Loop
Clicker: Loops
Summary 04
Exercise 4 (PDF)
5 Mon 18.10. RS: Floating Point II, Functions I Overlays [de] [en]
Handout [de] [en]
Lecture Code Examples
Clicker: Floating Point Loop
Clicker: Overhang
IEEE FP Converter
Tracing Function Calls
Summary 05
Exercise 5 (PDF)
Comparing Floating Point Numbers
Floating Point Guidelines
6 Mon 25.10. FF: Functions II, Reference Types I Overlays [de] [en]
Handout [de] [en]
Lecture Code Examples
Clicker: Intersect Intervals
Summary 06
Exercise 6 (PDF)
Slides 1
Slides 2
Self-Assessment II (Solutions: Squareroot, Program Output)
7 Mon 01.11. FF: Reference Types II, Vectors and Strings Overlays [de] [en]
Handout [de] [en]
Lecture Code Examples
Clicker: Funktionen und Effekte
Clicker: Referenzen
Summary 07
Exercise 7 (PDF)
Floating point numbers
8 Mon 08.11. RS: Vectors and Strings II, Recursion I Overlays [de] [en]
Handout [de] [en]
Lecture Code Examples
Clicker: Vectors
Clicker: Shortest Path
Clicker: Recursion
Summary 08
Exercise 8 (PDF)
Towers of Hanoi (EN)
9 Mon 15.11. RS: Recursion II, Structs Overlays [de] [en]
Handout [de] [en]
Lecture Code Examples
Summary 09
Clicker: Recursion (2)
Clicker: EBNF
Exercise 9 (PDF)
Self-Assessment III (Solutions: EBNF II, Zip)
10 Mon 22.11. RS: Structs and Overloading, Encapsulation and Classes Overlays [de] [en]
Handout [de] [en]
Summary 10
Lecture Code Examples
Clicker: Eisenbahn
Exercise 10 (PDF)
11 Mon 29.11. FF: Dynamic Data Types and Pointers Overlays [de] [en]
Handout [de] [en]
Zoom [Video]
Summary 11
Lecture Code Examples
Additional Pointer Slides
Clicker: Copy Constructor
Clicker: Pointers I
Exercise 11 (PDF)
Exercise 1
Exercise 2
12 Mon 06.12. FF: Iterators and Containers Overlays [de] [en]
Handout [de] [en]
Lecture Code Examples
Clicker: Pointers II
Summary 12
Exercise 12 (PDF)
Bubble Sort
Maximum Sort
13 Mon 13.12. RS: Memory Management with Classes Overlays [de] [en]
Handout [de] [en]
Lecture Code Examples
Clicker: Constructors
Summary 13
Exercise 13 (PDF)
Self-Assessment IV (Solutions: Dynamic Datatypes, Structs and Operators)
14 Mon 20.12. RS/FF: Subtyping, Polymorphism and Inheritance Overlays [de] [en]
Handout [de] [en]
complete course:
Overlays [de] [en]
Handout [de] [en]
Lecture Code Examples
Exercise 14 (PDF)

Registration for the exercise session

Registration for the exercise sessions will open on Monday, September 20th, and will be done via CodeExpert (link to be added).

Time and place

The following exercise sessions are offered:

Time Place Assistant
Tue 14-16HIT K 52Ciril Humbel
Tue 14-16HIT K 51Samuel Russo
Wed 10-12CAB G 56Manuel Kaufmann
Wed 10-12LFW B 3Adel Gavranovic
Tue 16-18CHN E 42Sverrir Thorgeirsson (EN)
Wed 16-18ML H 34.3Seyed Reza Sefidgar (EN)
Tue 16-18ONLINEHenry René George Raymond
Wed 10-12ONLINEAndrey Bryutkin
Wed 10-12ONLINEEliza Wszola (EN)

Note: Online and English exercise sessions are shared with another course and start from the first week.

Note: To attend an exercise session, you have to wear a mask that covers both your nose and mouth. Also, changing groups is strictly forbidden with the only exception: your are allowed to attend the online exercise session instead of your physical exercise session. If you are not feeling well, please stay at home and join the online exercise session to prevent the potential spread of the virus.

Backoffice assistants

Role Assistant Notes
Head TAVytautas Astrauskas (EN)Main contact for administrative questions

Bonus exercises

There will be 3 bonus exercises during the semester (see the agenda above for the schedule). By solving these exercises you will get up to 0.25 grade points added on top of your exam grade. In order to access the bonus exercises you need to unlock them in Code Expert by solving assignments from previous weeks and earning sufficiently many experience points (XP).


To facilitate the introduction to the lecture, especially for beginners in programming, we will provide an introductory tutorial, which can be completed autonomously. We strongly recommend to complete it in the first week of the semester.

Open C++-Tutorial

Hint: The tutorial is available in both German and English. You can switch the language any time.

Bjarne Stroustrup: Einführung in die Programmierung mit C++, Pearson Studium, 2010 | Also available online from the ETH Domain

Stephen Prata, C++ Primer Plus, Sixth Edition, Addison Wesley, 2012

Andrew Koenig and Barbara E. Moo: Accelerated C++, Addison-Wesley, 2000.


Prof. Dr. Bernd Gärtner and Dr. Michael Hoffmann kindly provided a script (lecture notes) that covers the material presented in the lecture.

Other useful resources

Old Exams

In order to get access to old exams and master solutions, please mark that you have understood the statement.

Primary educational objective of this course is to learn programming with C++. After having successfully attended the course, students have a good command of the mechanisms to construct a program. They know the fundamental control and data structures and understand how an algorithmic problem is mapped to a computer program. They have an idea of what happens “behind the scenes” when a program is translated and executed. Secondary goals are an algorithmic computational thinking, understanding the possibilities and limits of programming and to impart the way of thinking like a computer scientist.

The course covers fundamental data types, expressions and statements, (limits of) computer arithmetic, control statements, functions, arrays, structural types and pointers. The part on object orientation deals with classes, inheritance and polymorphism; simple dynamic data types are introduced as examples. In general, the concepts provided in the course are motivated and illustrated with algorithms and applications.