Computer Science | MATH/PHYS | AS 21

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

Date Message
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.
20.09.2021 Registration to the exercise sessions is now open. You can register here.
Lectures Tuesday 14:15 -- 16:00 HG F 7, HG F 5 (video), Livestream on the video portal
Exercises 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 Tue 21.09. RS/FF: Introduction, First C++ Program Organisation [de] [en]
Overlays [de] [en]
Handout [de] [en]
Lecture Video available on Video portal.
(Additional) Video 1.1 Introduction
(Additional) Video 1.2 First Program
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)
Self-Assessment 0 (Moodle)
2 Tue 28.09. FF: Integer Arithmetic and its Limits Overlays [de] [en]
Handout [de] [en]
Video portal.
Ariane 5 Video ❘ Details
Clicker: Ausdruckswert
Summary 02
Exercise 2 (PDF)
Self-Assessment I
3 Tue 05.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.
Summary 03 Assert Slides
For Loop Slides
Exercise 3 (PDF)
4 Tue 12.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 Tue 19.10. RS: Floating Point II, Functions I Overlays [de] [en]
Handout [de] [en]
Lecture Code Examples
IEEE FP Converter
Tracing Function Calls
Summary 05
6 Tue 26.10. FF: Functions II, Reference Types I Self-Assessment 2 (Moodle)
7 Tue 02.11. FF: Reference Types II, Vectors and Strings
8 Tue 09.11. RS: Vectors and Strings II, Recursion I
9 Tue 16.11. RS: Recursion II, Structs Self-Assessment 3 (Moodle)
10 Tue 23.11. FF: Structs and Overloading, Encapsulation and Classes
11 Tue 30.11. FF: Dynamic Data Types and Pointers
12 Tue 07.12. RS: Iterators and Containers
13 Tue 14.12. RS: Memory Management with Classes Self-Assessment 4 (Moodle)
14 Tue 21.12. RS/FF: Subtyping, Polymorphism and Inheritance

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 16-18CAB G 59Börge Keno Scheel
Tue 16-18CHN D 48Manuel Andreas Braunschweiler
Tue 16-18CHN E 42Sverrir Thorgeirsson (EN)
Tue 16-18LFW C 4Julia Xiangwei Meng
Tue 16-18HG E 33.1Manuel Jakob Kansy
Tue 16-18HG E 33.5Pia Katharina Herkenrath
Tue 16-18HG F 26.5Wiona Sophie Glänzer
Tue 16-18ONLINEHenry René George Raymond
Wed 10-12HG G 26.3Han-Miru Kim
Wed 10-12CHN G 46Elas Achler
Wed 10-12HG G 26.1Keanu Dave Gleixner
Wed 10-12HG E 21Damian Manetsch
Wed 10-12LFV E 41Manuel John Mekkattu
Wed 10-12HG D 3.1Vania Ludwig Etienne Dwight Vicenzi (IT)
Wed 10-12HG E 33.5Hrvoje Krizic
Wed 10-12LFW E 13Jérémie Jan Timothy Stroschein
Wed 10-12ML H 41.1Christopher Andreas Otto
Wed 10-12ONLINEAndrey Bryutkin
Wed 10-12ONLINEEliza Wszola (EN)
Wed 16-18ML H 34.3Seyed Reza Sefidgar (EN)

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.