Content
In this course we learn to use the programming language C++ to solve various programming problems. The course builds on content of the “Objectgeoriënteerd Programmeren” and “Datastructuren” 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. During the laptopcolleges feedback will be given on previous assignment and there is opportunity to ask questions on the current assignment or on material in the book. In order to track progress are advised to attend roughly 1 lab every 2 weeks.
Tools and environment
For this course we recommend using the operating system Ubuntu 20.04 or higher with compiler g++ 9.3 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. Pick whichever you like best, a small (random) selection from the many options is:
- Visual Studio Code setup instructions: C++ on Linux in VS Code
- Video showing how to setup the: Visual Studio Code Debugger
Visual studio Community (Windows/Mac)
Codelite
Eclipse
Codeblock
Netbeans
Assignments
assignment1: Date Problems | deadline see canvas |
assignment2: Simple Compression | deadline see canvas |
assignment3: Game of Life | deadline see canvas |
assignment4: Virus game | deadline see canvas |
The first assignments are relatively easy when you have experience with programming for example in Java. 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 your work at that time with some comments describing your problems. Assignments will be evaluated on:
- Correctness
- is tested and does what the assignment specified
- 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
- 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.
Exam
Only when 4 assignments are completed successfully are you allowed to take the final exam.
Earlier Midterm Exams
Deeltentamen2018
Deeltentamen2019
Earlier Final Exam
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.