Computer Science | MATH/PHYS | AS 19


Course catalog: 252-0847-00L
Lecturers: Malte Schwerhoff, Felix Friedrich


Primary educational objective 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.

Date Message
18.12.

Link to online exams: moodle link

3.1.2020

The full handout and full slide set published before Christmas was incomplete. This has now been fixed. As announced before Christmas, the chapter on polymorphism, inheritance and subtyping is not exam relevant.

8.1.2020

In order to get access to the master solutions of the moodle mock exams, we have now made the corresponding code-expert course accessible here . You can subscribe to this course here .

9.1.2020

Permitted examination aids: You may take up to 4 A4 sheets (= comprising 8 pages) into the exam. There are no constraints regarding content and layout (text, images, single/double page, margins, font size, etc.). Electronic devices and digital documents are not allowed.

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 P Prerequisites to unlock bonus exercises B Bonus exercises
1 17.09. Introduction, First C++ Program organisation [de] [en]
Overlays [de] [en]
Handout [de] [en]
Video
C++ Playground
power8.cpp
Summary 01
C++ Tutorial
Organisational Information
Exercise 1 (PDF)
Slides [de] [en]
Dots and Boxes
2 24.09. Integer Arithmetic and its Limits Overlays [de] [en]
Handout [de] [en]
Video
fahrenheit.cpp
bad_expression.cpp
limits.cpp
Ariane 5 Video ❘ Details
Clicker: Ausdruckswert
Zaubertrick
Summary 02
Exercise 2 (PDF)
3 01.10. Boolean Functions, Safe Programming, Control Flow I Overlays [de] [en]
Handout [de] [en]
Video
Lecture Code Examples
Bitwise Adder
Clicker: Mixed Int. Expr.
Summary 03
Exercise 3 (PDF)
4 08.10. Control Flow II, Floating Point I Overlays [de] [en]
Handout [de] [en]
Video
Lecture Code Examples
Clicker: for-Loop
Summary 04
Exercise 4 (PDF)
Slides
Handout
Dots and Boxes
5 15.10. Floating Point II, Functions I Overlays [de] [en]
Handout [de] [en]
Video
Lecture Code Examples
Clicker: 110
Clicker: Overhang
Tracing Function Calls
Summary 05
Exercise 5 (PDF)
Slides
Comparing Floating Point Numbers
Floating Point Guidelines
Nonogram
6 22.10. Functions II, Reference Types I Overlays [de] [en]
Handout [de] [en]
Video
Lecture Code Examples
Clicker: Intersect Intervals
Summary 06
Exercise 6 (PDF)
Slides 1
Slides 2
7 29.10. Reference Types II, Vectors and Strings Overlays [de] [en]
Handout [de] [en]
Video
Lecture Code Examples
Clicker: Referenzen
Clicker: Vectors
Summary 07
Exercise 7 (PDF)
Floating point numbers
References
8 05.11. Vectors and Strings II, Recursion I Overlays [de] [en]
Handout [de] [en]
Video
Lecture Code Examples
Summary 08
Clicker: Shortest Path
Clicker: Recursion
Exercise 8 (PDF)
Towers of Hanoi
Nonogram
9 12.11. Recursion II, Structs Overlays [de] [en]
Handout [de] [en]
Video
Lecture Code Examples
Summary 09
Clicker: Recursion (2)
Clicker: EBNF
Exercise 9 (PDF)
EBNF
Binary Search Tree
10 19.11. Structs and Overloading, Encapsulation and Classes Overlays [de] [en]
Handout [de] [en]
Video
Lecture Code Examples
Summary 10
Clicker: Eisenbahn
Exercise 10 (PDF)
11 26.11. Dynamic Data Types and Pointers Overlays [de] [en]
Handout [de] [en]
Lecture Code Examples
Additional Pointer Slides
Clicker: Copy Constructor
Clicker: Pointers I
Summary 11
Exercise 11 (PDF)
Exercise 1
Exercise 2
12 03.12. Iterators and Containers Overlays [de] [en]
Handout [de] [en]
Lecture Code Examples
Clicker: Recursive Structs
Summary 12
Exercise 12 (PDF)
Binary Search Tree
13 10.12. Memory Management with Classes Overlays [de] [en]
Handout [de] [en]
Lecture Code Examples
Clicker: Constructors
Summary 13
Exercise 13 (PDF)
Slides
14 17.12 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 16th.

Time and place

The following exercise sessions are offered:

Time Place Assistant
Tue 15-17HG E 33.1Vytautas Astrauskas (EN)
Tue 15-17CHN E 42Reza Sefidgar (EN)
Wed 10-12LFW E 13Tobias Klenze
Tue 15-17CHN D 44Benjamin Rothenberger
Tue 15-17CHN D 48David Sommer
Tue 15-17HG E 33.5Enis Ulqinaku (EN)
Tue 15-17HG D 5.1Moritz Schneider
Tue 15-17CAB G 59Sammy Christen
Tue 15-17LFW C 4Charlotte Franke
Wed 10-12ML H 41.1Viera Klasovita
Wed 10-12HG D 3.1Orhan Saeedi
Wed 10-12CHN G 46Claire Dick
Wed 10-12HG G 26.3Jannik Kochert
Wed 10-12HG G 26.1Edoardo Mazzoni (IT)
Wed 10-12HG E 33.5Janet Greutmann
Wed 10-12HG E 21Tanja Kaister
Wed 10-12HG D 5.3Raul Rao
Wed 10-12HG D 3.3Kevin Kaiwen Zhang
Wed 10-12HG D 5.1Manuel Mekkattu

Assistants marked with EN teach in English, IT – Italian, all others in German.

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).

Contact

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.

C++ Tutorial Öffnen

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.

Script

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.