Programming in C++.

Lecture: Wednesday 16-18, Sal 25.
Laboratory (Hans de Nivelle): Wednesday 18-20, Sal 7
Laboratory (Marek Szykuła): Tuesday 16-18, Sal 110
Laboratory (Marek Szykuła): Tuesday 18-20, Sal 110
Laboratory (Jan Otop): Friday 10-12, Sal 7

Prerequisites

Experience in at least one programming language, e.g. C, Java or Python.

Laboratory Rules

Introduction

C++ is a language that starts at low level, but which is designed in such a way that a programmer can build high-level components inside the language. When you are working on a large project, you build your components, and after that do not use the low-level features anymore in the rest of the project. If you are joining an existing project or using libraries, you probably never have to deal with the low-level aspects of the language. If you are working on a large project, and after half a year still doing low-level programming, then you are doing something wrong. The bad reputation of C++ is caused by programmers and teachers that never manage to escape from the low-level programming.

Schedule

Useful Sites

Exercises

  1. Exercise number 1. Basics of Linux. Example of a makefile.
  2. Exercise number 2. You need the following files: Makefile, rational.h, rational.cpp, vector.h, matrix.h, matrix.cpp, main.cpp.
  3. Exercise number 3.
  4. Exercise number 4. You need these additional files.
  5. Number 5. You need the files in nr05. (Note that there are problems with task 5. The non-const operator[] cannot be made robust against assignments of form t[0] = t, when t is not shared. Method replacesubtree( ) in task 7 is OK. )
  6. Number 6. You need the files in nr06.
  7. Number 7 about usage of std::map and std::unordered_map. This exercise is different from last year.
  8. Exercise 8 about solving the 15-puzzle, using unordered_map and priority_queue. You need these files. (If you have a version with 5 tasks, reload it, because there are now only 3.) Note that the task uses exceptions in an improper way. Next year, the task will be without exceptions, and there will be some more chances.
  9. Exercise 9 about computer algebra using templates. You need these files.
  10. Exercise 10 about use of templates for physical units. You need these files. (I made some changes on 25.05 in the morning, please reload.)
  11. Exercise 11 about inheritance.
  12. Exercise 12 has two versions: Game of Life or Rubik's Cube.

Grading 2017

There were 12 exercises. Every exercise counts as 10 points. This means that there are 120 points in total. Exercises 1,2,3,4,5 must be made in all cases. Grades are obtained from the points as follows:

70 => 3.0
80 => 3.5
90 => 4.0
100 => 4.5
110 => 5.0