Informatik - HS 2018 [252-0856-00], [252-0835-00], [252-0835-AA]

Computational Science and Engineering Course at D-MATH

Felix Friedrich, Malte Schwerhoff, ETH Computer Science Department

The course covers the fundamental concepts of computer programming with a focus on systematic algorithmic problem solving. Primary educational objective is to learn programming with C++. When having successfully attended the course, students have a good command of the mechanisms to construct a program. They know 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 of a computer scientist.

Because this is primary a course for Bachelor students at ETH, instruction language is German. Exercises are offered in English. Teaching language of one of the exercise sessions is English. German and English lecture slides are available for download. Exams will be bilingual.

Lecture notes can be downloaded here. Relevant for the exam is both, the content of the course and the exercises.

Slack channel invitation: here .

Date Message
3.12.2018 Electronic Trial Exams on Wednesday, December 5th, will take place 11:00 -- 12:00 in rooms HG D 11, HG D 12, HG E 19 and HG E 27. Please go to one of the exercise sessions in LFW B3 or LFW E 13 at 10:15. In the exercise lesson in the afternoon there will be a mock exam on paper.
11.12.2018 The paper version of the exams from 2012.05 and the exam from August 2018 are online (in the exams section below). We will make the Moodle exam available soon.
14.12.2018 Slides and lecture material for week 14 week online.


Lectures Mon 08:15 -- 10:00 CHN C 14
Exercise Sessions Wed 10:15-12:00, 13:15--15:00Various Rooms (cf below)
Week Date Topic Lecture Additional Material Exercises PPrerequisites to unlock bonus exercises BBonus exercises
0 17.9. --- no lecture [Organisation] [Registration]
1 24.09. Introduction, Expressions and Statements organisation [de] [en]
handout [de] [en]
lecture [de] [en]
[Code Examples]

[Exercise 1]
[Summary 1]
[Solution to self-assessment]
2 01.10. Integer Arithmetic and its Limits handout [de] [en]
lecture [de] [en]
[Code Examples]
[expression value]
[Exercise 2]
[Summary 2]
[Binary representation]
3 08.10. Boolean Functions, Safe Programming, Control Flow I handout [de] [en]
lecture [de] [en]
[Code Examples]
[Ariane 5 Video]
[Explanation Ariane 5]
[Exercise 3]
[Summary 3]
[For loop]
4 15.10. Control Flow II, Floating Point I handout [de] [en]
lecture [de] [en]
[Code Examples]
[Exercise 4]
[Summary 4]
[While/do loop]
5 22.10. Floating Point II, Functions I handout [de] [en]
lecture [de] [en]
[Code Examples]
[Overhang Clicker]
[IEEE 754 Converter]
[Exercise 5]
[Summary 5]
[Floating point guideline]
6 29.10. Functions II, Reference Types handout [de] [en]
lecture [de] [en]
[Code Examples]
[Interval Clicker]
[Exercise 6]
[Summary 6]
[Exercise - Swap]
7 05.11. Reference Types II, Vectors and Strings handout [de] [en]
lecture [de] [en]
[Code Examples]
[Functions Clicker]
[References Clicker]
[Exercise 7]
[Summary 7]
8 12.11. Vectors and Strings II, Recursion I handout [de] [en]
lecture [de] [en]
[Code Examples]
[Vectors Clicker]
[ShortestPath Clicker]
[Exercise 8]
[Summary 8]
[Towers of Hanoi]
[Recursion trees]
[Storing a matrix]
9 19.11. Recursion II, Structs and Overloading handout [de] [en]
lecture [de] [en]
[Code Examples]
[Recursion Clicker]
[EBNF clicker]
[Exercise 9]
[Summary 9]
[Struct for points and lines]
[Struct for tribools]
Bonus Exercise 3
10 26.11. Classes and Encapsulation handout [de] [en]
lecture [de] [en]
[Code Examples]
[Structs Clicker]
[Classes clicker]
[Exercise 10]
[Summary 10]
[Max. sort]
[Bubble sort]
11 03.12. Dynamic Data Types and Pointers handout [de] [en]
lecture [de] [en]
[Code Examples]
[Pointers I Clicker]
[additional pointer slides]
[Exercise 11]
[Summary 11]
Electronic Trial Exams on Wednesday 11:00 -- 12:00 in HG D 11, HG D 12, HG E 19 and HG E 27.
Paper mock exam on Wednesday afternoon.
12 10.12. Linked Lists, Iterators and Containers handout [de] [en]
lecture [de] [en]
[Code Examples]
[Exercise 12]
[Summary 12]
[Additional exercises on pointers]
[Reverse copy]
Bonus Exercise 3
13 17.12. Memory Management with Classes handout [de] [en]
lecture [de] [en]

all handouts
[de] [en]
all overlays
[de] [en]
[Code Examples]
[Constructors Clicker]
[Summary 13]
[Self-assesment] [Solutions]
[Addendum to self-assessment] [Solutions]

Registration for the exercise session

The Registration link is open.

Time and place

The following exercise sessions are offered:

Department Time Place Assistant
CSE/CBBWed, 10-12 CAB G 56 Manuel Kaufmann
CSE/CBB [english]Wed, 10-12 LFW B 3 Robin Worreby
CSE/CBBWed, 10-12 LFW E 13 Sebastian Balzer
ITET/CBBWed, 13-15 LFW E 13 Roger Barton

The session will be held in English

Bonus exercises

This year there will be 3 bonus exercises during the semester (see the Agenda for the schedule). By solving these exercises you will get extra points in the final exam. In order to access the bonus exercises you need to unlock them in Code Expert by solving assignments from previous weeks and earning enough experience points (XP).


For questions about the lecture content of about a specific exercise you can contact your assigned assistant. For administrative questions you can contact the Head TA, Francois Serre.

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

Open C++ Tutorial

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

Old Exams

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

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

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

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

Other useful resources