Credits
6
Types
Compulsory
Requirements
This subject has not requirements
, but it has got previous capacities
Department
CS
Teachers
Person in charge
- Jordi Delgado Pin ( jdelgado@cs.upc.edu )
Weekly hours
Theory
2
Problems
0
Laboratory
2
Guided learning
0
Autonomous learning
6
Competences
Transversals
Especifics
Generic
Objectives
-
Learn the most basic concepts of programming with functions (simple and high-order) and their use as tools to adapt a programming language to the domain of the problem to be solved
Related competences: CG2, CT6, CE03, CE10, CE12, -
Learn the concept of recursion and how to distinguish iterative and recursive processes defined with recursive functions
Related competences: CG4, CT6, CE03, CE10, CE12, -
Initiate the student in the understanding of the concept of software design
Related competences: CG4, CT6, CE03, CE10, -
Being able to deal with the idea of an error in a program and using exceptions to cope with these errors
Related competences: CG4, CE10, -
Learn the concept of container and the situations in which it is relevant to use them. Know the cost of its use (informally)
Related competences: CG4, CT6, CE02, CE04, -
Introduce the student to the computation of the complexity of algorithms
Related competences: CE13, -
Involve the student in the design and implementation of a simple problem collaborating with other students
Related competences: CG2, CG4, CG8, CT4, CE03, CE10,
Contents
-
Building Abstractions with Functions: Functions (simple and high-order). Environments. Execution flow control.
The student is introduced to the main problem-solving mechanism, from a bottom-up point of view, of designing functions that bring the programming language closer to the domain of the problem. The mechanisms of function definition, parameter passing, environment and scope, and the main control structures of the execution flow (conditional, iterative) are studied. -
Building Abstractions with Functions: Recursion and examples.
The fact that a function is able to call itself is introduced, and how this leads to recursion as a conceptual mechanism for solving problems, and the idea of process. Recursive functions may define iterative and recursive processes. -
Building Abstractions with Functions: Design. Error handling with exceptions.
The concept of designing a program to solve a problem is introduced. The idea of error in a program and how to deal with them by means of the exception mechanism is introduced. -
Building Abstraccions with Functions: Examples of solving problems
The concepts introduced so far are reinforced with numerous problems of low and medium difficulty. -
Building Abstractions with Functions: Containers
We start working with containers provided by the programming language: Sequences, Lists, Dictionaries and others implemented within the course, such as Matrices or Trees. -
Building Abstractions with Functions: Mutability. Iterators and Generators.
The concept of mutability is first seen in relation to lists, and the advantages and disadvantages of having immutable data structures are discussed. Iterators and generators are introduced as new control structures. -
Introduction to Algorithm Complexity
A short introduction is made to asymptotic notation and to the complexity in the worst case of some notable algorithms seen during the course.
Activities
Activity Evaluation act
Building Abstractions with Functions: Functions and Control Structures
The student should pay attention to the lecture and he/she should work through the exercises suggested by the lecturer.Objectives: 1 2 3 4
Contents:
- 1 . Building Abstractions with Functions: Functions (simple and high-order). Environments. Execution flow control.
- 2 . Building Abstractions with Functions: Recursion and examples.
- 3 . Building Abstractions with Functions: Design. Error handling with exceptions.
- 4 . Building Abstraccions with Functions: Examples of solving problems
Theory
10h
Problems
0h
Laboratory
12h
Guided learning
0h
Autonomous learning
30h
Algorithm Complexity
The student should pay attention to the lecture and he/she should work through the exercises suggested by the lecturer.Objectives: 6
Contents:
Theory
3h
Problems
0h
Laboratory
4h
Guided learning
0h
Autonomous learning
10h
Teaching methodology
Teaching the course is structured in lectures and laboratory sessions.Teachers will use lectures to introduce the essential contents of the course. In the laboratory sessions the contents of the course will be brought to the computer by carrying out practical problems. The laboratory classes will be a continuation of the lectures, where new concepts will be implemented as they appear in lectures.
Evaluation methodology
Grading the course will consist of two theoretical tests (T1 and T2), one mid-course and the other at the end, and one medium-sized practical work (Practice).Then, the evaluation method would be:
0.8 * Theory + 0.2 * Practice
where:
Theory: MAX(T2, 0.5 * T1 + 0.5 * T2)
Reassessment: Only those who have failed the theory part, after taking the final exam, may take the reassessment. The maximum grade that can be obtained in the reassessment is 7.
Teamwork:
Evaluated using a simple rubric that each group tutor group uses
to rank different aspects of teamwork of every member of the group.
Bibliography
Basic
-
Composing Programs (on-line)
- DeNero, John,
https://www.composingprograms.com -
Structure and interpretation of computer programs
- Abelson, Harold; Sussman, Gerald Jay; Sussman, Julie,
MIT Press [etc.],
1996.
ISBN: 9780262011532
https://discovery.upc.edu/discovery/fulldisplay?docid=alma991002456139706711&context=L&vid=34CSUC_UPC:VU1&lang=ca -
Python pocket reference
- Lutz, Mark,
O'Reilly Media, Inc.,
2014.
ISBN: 9781449356941
Web links
- Aquest és el text PRINCIPAL de l'assignatura, la font d'informació primària per a tot allò que expliquem a classe. http://www.composingprograms.com/
- Aquest és el curs CS 61A: Structure and Interpretation of Computer Programs, de l'Universitat de Berkeley, en el que aquest curs està basat https://cs61a.org/
- La principal referència del llenguatge de programació que fem servir: Python. No és un lloc on aprendre a programar, és un lloc on consultar detalls de les construccions i llibreries del llenguatge https://docs.python.org/3/reference/index.html