C++ Programming Methods 2023-2024

Content

In this course we learn to use the programming language C++ to solve various programming problems. The course builds on content of the “Introductie in Programmeren” and “Datastructuren en Algoritmen” courses but these are not required to start with this course. We will be concerned with the most important elements of C++ to solve various programming assignments. Students are expected to study selected chapters from the book on their own. Programming is learned through practice, therefore we spend a large part of this course working on assignments.

Literature

Absolute C++ by Walter Savtich, international/global/5th edition or later.

Reading guide, we advice to read 1 chapter each week in this order:

  • Ch.1 C++ basics
  • Ch.2 Flow of Control
  • Ch.3 Function Basics
  • Ch.4 Parameters and Overloading
  • Ch.12 Streams and File I/O
  • Ch.5 Arrays
  • Ch.6 Structures and Classes
  • Ch.7 Constructors and Other Tools
  • Ch.8 Operator Overloading, Friends, and References
  • Ch.9 Strings
  • Ch.10 Pointers and Dynamic Arrays
  • Ch.11 Separate Compilation and Namespaces
  • Ch.14 Inheritance
  • Ch.15 Polymorphism and Virtual Functions

Schedule

See Datanose for the schedule. There are two laptopcolleges every other week. In these laptopcolleges we will present the same information so you are advised to attend just one of these every two weeks. In the first week with laptopcolleges there will be a lecture where new C++ material is presented. In the following week with laptopcolleges there is opportunity to work on and ask questions about the current assignment. This pattern of alternating weeks of lectures and working on assignment repeats throughout the course.

Tools and environment

For this course we recommend using the operating system Ubuntu 22.04 or higher with compiler g++ 11.04 or higher. However, you are free to use any you like as long as your source code is portable. To make it portable do not use headers or libraries specific to your platform (no #include <windows.h>), these will not help much with the assignments anyway. If you stick to what is described in the book you will be fine.

We recommend using an Integrated Development Environment (IDE) to help you write and debug your code.
You can pick your own but we highly recommend:

Visual Studio Code

Assignments

There are four assignments to complete:

The first assignments are relatively easy when you have experience with programming for example in Python. But with later assignments (especially the last) your experience with other languages won’t help you much.

Assignments are to be uploaded to Canvas before their respective deadline passes. In the event you were not able to finish an assignment we recommend to upload the work that you did do with some comments describing your problems. Assignments will be evaluated on:

  1. Correctness
    • works correctly, does what the assignment specified
  2. Design
    • is not more complex than necessary
    • does not have the same logic at multiple places
    • is decomposed in a logical way in functions and/or classes
  3. Readability
    • uses intuitive names
    • comments are there where they are useful
    • layout is consistent

Each assignment is made individually, however you are encouraged to discuss the design and the way in which you tackle a problem. But it is not allowed to share source code. This could be considered plagiarism and/or fraud and can have serious consequences. Only when 4 assignments are completed successfully are you allowed to take the final exam. If you fail an assignments you will have to make an extra compensation assignment in order to compensate.

Exam

Practice exams are available:

Earlier Midterm Exams

Deeltentamen2018
Deeltentamen2019
Deeltentamen2022

Earlier Final Exams

Deeltentamen2_2019
Deeltentamen2_2022

Origin

This course was originally derived from the Programmeermethoden course at the Leiden University by Walter Kosters. Earlier versions of the assignments were written by Tijmen Blankevoort, Auke Wiggers, Eugenio Bargiacchi and Georgios Methenitis. Earlier years of this course were organised by Arnoud Visser.