Principles of Computer Programming (B-KUL-G0N28A)
![](/resources/images/icons/icon-docent.png)
Aims
This course offers concepts and techniques to solve and to implement small problems by means of a higher programming language. The course also introduces students to the paradigm of object oriented programming and to the paradigm of functional programming, which are used in the development of larger programs. The course emphasizes the concepts and techniques, rather than the programming language itself.
Final requirements
* Draw up solutions for algoritmic problems by means of functional decompositions ("divide-and-conquer").
* Implement algorithms both in an iterative way and in a recursive way.
* Insight into the internals of data structures such as lists, sets and maps.
* Insight into various algorithms to sort data.
* Reason about the correctness and finiteness of simple algorithms
* Assess the time complexity and the memory complexity of simple algorithms.
Previous knowledge
No specific knowledge required.
Order of Enrolment
This course unit is a prerequisite for taking the following course units:
H01O9A : Data Base Systems
G0P36B : Computer aided Problem Solving in Physics
H01P5B : Computer Architecture and Software Systems
Identical courses
This course is identical to the following courses:
H01B6B : Fundamentals of Computer Science
X0A06A : Principles of Computer Programming
X0A06B : Principles of Computer Programming
Is included in these courses of study
- Bachelor of Informatics (Leuven) 180 ects.
- Bachelor of Mathematics (Leuven) 180 ects.
- Bachelor of Physics (Leuven) 180 ects.
- Bachelor of Geography (Leuven) (Minor Subject: Mathematics and Physics) 180 ects.
- Master of Teaching in Science and Technology (Leuven) 120 ects.
Activities
3 ects. Principles of Computer Programming: Lecture (B-KUL-G0N28a)
Content
1. Basic programs
• Implementation of simple programs only involving assignments, conditional statements, input/output and the invocation of predefined functions.
* Introduction to the architecture of computers and the way they execute programs.
• Concepts: variables, expressions (both numeric and string), assignments, conditional statements, input/output, function calls.
2. Iterative programs (algorithms)
• Disciplined development of iterative programs using the paradigm of structured programming and of functional decomposition.
* Proofs of correctness and of finiteness of simple algorithms (a.o by means of induction over the loop invariant).
• Assessment of the complexity of simple algorithms, with emphasis on time complexity.
• Processing of mistakes that occurred during execution.
• Concepts: iterative statements, structured data types (lists, maps, tupples, sets and matrices), loop invariants and loop variants, exceptions.
3. Recursive programs
• Recursive implementation of algorithms using the paradigm of divide-and-conquer.
• Insight into the execution of recursive programs.
• Concepts: function definitions, parameter binding, local and global scope, documentation, runtime stack.
4. Introduction to object oriented programming
• Introduction to the structuring concepts of object oriented programming
• Functions: parameter binding, return values, scope, reuse of functions, stepwise refinement.
• Concepts: classes, objects, constructors, inheritance.
5. Applications
• Sorting and searching: insight into various strategies to sort data (iselection sort, bubble sort, insertion sort, counting sort, quick sort, heap sort, merge sort) and to search data (linear search, binary search).
• Real numbers: insight into rounding errors during computations with floating point numbers.
• Simple simulation and optimisation problems.
All programs are written in the programming language Python.
In this course, students also get to know the relevance and current challenges of Informatics.
Course material
Handbook; slides
Format: more information
Lectures for a large group of students in an auditorium
3 ects. Principles of Computer Programming: Exercises (B-KUL-G0N78a)
Course material
Assignments and solutions
Format: more information
Computer session - Practice session
Exercises are solved in an interactive way. The sessions are organized for small groups under supervision of one or more teaching assistants. All exercises are solved on computer.
Evaluation
Evaluation: Principles of Computer Programming (B-KUL-G2N28a)
Explanation
Part I: theory and small questions
Part II: programming exercises
Information about retaking exams
Part I: theory and small questions
Part II: programming exercises