Programming I

Credits
7.5
Types
Compulsory
Requirements
This subject has not requirements, but it has got previous capacities
Department
CS;ICE
Mail
The course covers the basic concepts and techniques for building programs in imperative languages. By the end of the course, the student will:

1. Know the basic constituents of imperative languages: variables, types, expressions, conditional statement, and iteration.

2. Be able to use and design procedures and functions to encapsulate solutions to subproblems.

3. Be able to use the methodology of stepwise refinement for solving programming problems of non-trivial complexity.

4. Be able to use vectors to store structured information and as the base of data structure design.

5. Know and be able to reproduce and use some fundamental algorithms such as binary search and elementary vector sorting methods.

Currently, the programming language used is C++, although the emphasis is not on learning a specific language but in algorithmic problem solving and structured program construction.

Teachers

Person in charge

  • Emma Rollón Rico ( )
  • Jorge Castro Rabal ( )

Others

  • Alfonso Valverde Ruiz ( )
  • Edelmira Pasarella Sanchez ( )
  • Glyn Morrill ( )
  • Guillem Godoy Balil ( )
  • Jose Carmona Vargas ( )
  • Josep Sànchez Ferreres ( )
  • Lluis Padro Cirera ( )
  • Maria Angela Nebot Castells ( )
  • Nicolas Mylonakis Pascual ( )
  • Raúl López Sánchez ( )
  • Rosa Maria Jiménez Gómez ( )

Weekly hours

Theory
2
Problems
0
Laboratory
3
Guided learning
0.5
Autonomous learning
7

Competences

Technical Competences

Common technical competencies

  • CT1 - To demonstrate knowledge and comprehension of essential facts, concepts, principles and theories related to informatics and their disciplines of reference.
    • CT1.1A - To demonstrate knowledge and comprehension about the fundamentals of computer usage and programming, about operating systems, databases and, in general, about computer programs applicable to the engineering.
    • CT1.1B - To demonstrate knowledge and comprehension about the fundamentals of computer usage and programming. Knowledge about the structure, operation and interconnection of computer systems, and about the fundamentals of its programming.
    • CT1.2B - To interpret, select and value concepts, theories, uses and technological developments related to computer science and its application derived from the needed fundamentals of mathematics, statistics and physics. Capacity to understand and dominate the physical and technological fundamentals of computer science: electromagnetism, waves, circuit theory, electronics and photonics and its application to solve engineering problems.
  • CT4 - To demonstrate knowledge and capacity to apply the basic algorithmic procedures of the computer science technologies to design solutions for problems, analysing the suitability and complexity of the algorithms.
    • CT4.1 - To identify the most adequate algorithmic solutions to solve medium difficulty problems.
    • CT4.2 - To reason about the correction and efficiency of an algorithmic solution.
  • CT5 - To analyse, design, build and maintain applications in a robust, secure and efficient way, choosing the most adequate paradigm and programming languages.
    • CT5.2 - To know, design and use efficiently the most adequate data types and data structures to solve a problem.
    • CT5.3 - To design, write, test, refine, document and maintain code in an high level programming language to solve programming problems applying algorithmic schemas and using data structures.
    • CT5.4 - To design the programs¿ architecture using techniques of object orientation, modularization and specification and implementation of abstract data types.
  • CT8 - To plan, conceive, deploy and manage computer projects, services and systems in every field, to lead the start-up, the continuous improvement and to value the economical and social impact.
    • CT8.6 - To demonstrate the comprehension of the importance of the negotiation, effective working habits, leadership and communication skills in all the software development environments.

Transversal Competences

Autonomous learning

  • G7 - To detect deficiencies in the own knowledge and overcome them through critical reflection and choosing the best actuation to extend this knowledge. Capacity for learning new methods and technologies, and versatility to adapt oneself to new situations.
    • G7.1 - Directed learning: perform the assigned tasks in the planned time, working with the indicated information sources according to the guidelines of the teacher or tutor. To identify the progress and accomplishment grade of the learning goals. To identify strong and weak points.

Objectives

  1. Understand how to build a program and use tools the necessary tools: console, editor and compiler.
    Related competences: G7.1, CT1.1B, CT1.1A,
  2. Understand the syntax and semantics of basic expressions and instructions in an imperative programming language (C++).
    Related competences: CT5.3,
  3. Use functions and actions to develop programs.
    Related competences: G7.1, CT4.1, CT5.4,
  4. Understand the concepts of function, action and parameter passing
    Related competences: CT4.1,
  5. Understand tables and identify problems for which their use is appropriate.
    Related competences: CT4.1, CT5.2, CT5.3,
  6. Compare solutions regarding time and memory use and choose the most appropriate solutions for simple cases.
    Related competences: CT4.1, CT4.2, CT5.2,
  7. Understand search and traversal diagrams.
    Related competences: CT4.2, CT1.2B,
  8. Associate a problem with an appropriate solution scheme
    Related competences: CT4.1, CT5.3,
  9. Understand recursion and develop recursive solutions for simple problems.
    Related competences: CT4.1, CT4.2, CT5.3,
  10. Understand binary search, insertion, sorting, selection, mergesort and quicksort algorithms.
    Related competences: CT4.1, CT4.2, CT5.2,
  11. Understand other fundamental algorithms: Hörner, fast product
    Related competences: CT4.1, CT1.2B, CT1.1A,
  12. Write programs of about one page in length that are readable, efficient and elegant.
    Related competences: G7.1, CT8.6, CT4.1, CT4.2, CT5.2, CT5.4, CT5.3, CT1.1B, CT1.2B, CT1.1A,

Contents

  1. Basic programming principles
    Introduction to fundamental concepts: algorithm, program, variable, expression, data type, etc. Basic C++ instructions.
  2. Iterative instructions
    For and while instructions. Examples.
  3. Traversal and search diagrams
    Sequences. Sequential traversal and search.
  4. Actions and functions
    Actions and functions. Parameter passing. Visibility levels.
  5. Recursion
    Introduction to recursive design.
  6. Tables
    One-dimensional tables. Multidimensional tables. Traversals and searches in tables.
  7. Tuples
    Programming with tuples.
  8. Basic algorithms I
    Sorting algorithms. Binary search.
  9. Basic algorithms II
    Other important algorithms: Hörner, fast product, etc.

Activities

Activity Evaluation act


Topic development: Basic programming principles

Understand and assimilate the concepts covered in theory classes. Solve the problems set for this topic, available at www.jutge.org.
Objectives: 1 2
Contents:
Theory
2h
Problems
0h
Laboratory
3h
Guided learning
0h
Autonomous learning
6h

Topic development: Iterative instructions

Understand and assimilate the concepts covered in theory classes. Solve the problems set for this topic, available at www.jutge.org.
Objectives: 1 2
Contents:
Theory
2h
Problems
0h
Laboratory
3h
Guided learning
0h
Autonomous learning
6h

Topic development: Traversal and search schemes

Understand and assimilate the concepts covered in theory classes. Solve the problems set for this topic, available at www.jutge.org.
Objectives: 2 7 8
Contents:
Theory
2h
Problems
0h
Laboratory
3h
Guided learning
0h
Autonomous learning
6h

Topic development: Actions and functions.

Understand and assimilate the concepts covered in theory classes. Solve the problems set for this topic, available at www.jutge.org.
Objectives: 2 4 3
Contents:
Theory
2h
Problems
0h
Laboratory
3h
Guided learning
0h
Autonomous learning
6h

Topic development: "Recursion"

Understand and assimilate the concepts covered in theory classes. Solve the problems set for this topic, available at www.jutge.org.
  • Guided learning: Test 1
Objectives: 4 3 9
Contents:
Theory
2h
Problems
0h
Laboratory
3h
Guided learning
0.8h
Autonomous learning
6h

Consolidation: topics 1 to 5

Understand and assimilate the concepts covered in theory classes. Solve the problems set for the purpose of consolidating the first part of the course at www.jutge.org.
Objectives: 1 2 4 3 7 8 9
Contents:
Theory
4h
Problems
0h
Laboratory
6h
Guided learning
0h
Autonomous learning
12h

Topic development: Tables

Understand and assimilate the concepts covered in theory classes. Solve the problems set for this topic, available at www.jutge.org.
  • Guided learning: Test 2
Objectives: 5 6 7 8 12
Contents:
Theory
4h
Problems
0h
Laboratory
6h
Guided learning
0.9h
Autonomous learning
12h

Topic development: Tuples

Understand and assimilate the concepts covered in theory classes. Solve the problems set for this topic, available at www.jutge.org.
Objectives: 12
Contents:
Theory
2h
Problems
0h
Laboratory
3h
Guided learning
0h
Autonomous learning
6h

Topic development: Basic algorithms I

Understand and assimilate the concepts covered in theory classes. Solve the problems set for this topic, available at www.jutge.org.
Objectives: 5 6 10 12
Contents:
Theory
2h
Problems
0h
Laboratory
3h
Guided learning
0h
Autonomous learning
6h

Topic development: Basic algorithms II

Understand and assimilate the concepts covered in theory classes. Solve the problems set for this topic, available at www.jutge.org.
Objectives: 6 11 12
Contents:
Theory
2h
Problems
0h
Laboratory
3h
Guided learning
0h
Autonomous learning
6h

Consolidation

Solve the problems set for this topic, available at www.jutge.org.
  • Guided learning: Test 3 + Mid-semester exam + Final exam
Objectives: 12
Contents:
Theory
6h
Problems
0h
Laboratory
9h
Guided learning
5.8h
Autonomous learning
33h

Test 1

Complete, using www.jutge.org, a programming exercise. Before being allowed to sit this test, students may be asked to individually resolve a number of exercises from a list.
Objectives: 1 2
Week: 6 (Outside class hours)
Type: lab exam
Theory
0h
Problems
0h
Laboratory
0h
Guided learning
0h
Autonomous learning
0h

Test 2

Complete, using www.jutge.org, a programming exercise. Before being allowed to sit this test, students may be asked to individually resolve a number of exercises from a list.
Objectives: 4 3 7
Week: 10 (Outside class hours)
Type: lab exam
Theory
0h
Problems
0h
Laboratory
0h
Guided learning
0h
Autonomous learning
0h

Test 3

Complete a programming exercises using www.jutge.org. Before being allowed to sit this test, students may be asked to individually resolve a number of exercises from a list.
Objectives: 5 6 8 9
Week: 15 (Outside class hours)
Type: lab exam
Theory
0h
Problems
0h
Laboratory
0h
Guided learning
0h
Autonomous learning
0h

Final exam

On-computer exam. Global course evaluation, emphasizing last chapters
Objectives: 10 11 12
Week: 15 (Outside class hours)
Type: final exam
Theory
0h
Problems
0h
Laboratory
0h
Guided learning
0h
Autonomous learning
0h

Teaching methodology

In the theory sessions, the lecturer will alternate new theoretical concepts with examples and exercises. Lectures, in which the course topics are presented, explained and illustrated, will be combined with student interaction regarding the various alternatives arising in the resolution of practical cases.

The laboratory sessions have two distinct parts:
During the first hour, a guided session takes place, where the lecturer describes practical issues regarding the programming environment, or some exercises are solven in a collaborative way, or some code is analyzed to identify errors, etc.
Then students devote the remaining two hours to solve problems with the automatic judge with the assistance of the lecturer if needed.

Students are expected, in the laboratory sessions and in home study, to resolve problems from a set of problems and upload their solutions to an automatic judge for checking by comprehensive test suites. They are also advised to regularly consult their lecturer about their programs (irrespective of whether they work) for an evaluation of their quality.

Evaluation methodology

In this course three partial exams C1, C2 and C3 are taken.

With the combined grades of the three exams, a continuous assessment grade AC is computed using formula [1].
[1] AC = 0.2*C1 + 0.3*C2 + 0.5*C3

Students with AC>=5 are considered to pass the course with final grade AC.

Students with AC<5 must take the final exam (F). The course final grade NF will then be computed with formula [2].
[2] NF = max (F, (AC + F) / 2).

Students with AC>=5 may take the final exam only if they explicitly request the change to evaluation formula [2]. The change will be irreversible.

To be eligible for one exam, it will be necessary to have solved a minimum of problems from lists associated with each exam, according to the procedure and time limits specified in each case at the course web page.

Each exam grade combines an automatic scores yield by the Judge and manual scores. The weight of automatic or manual scores, counted globally among all exams, will not be less than 30%.

Correction of the final exam will be entirey manual.

RE-EVALUATION
Re-evaluation consists of an presential intensive course of 12 hours plus an evaluation, taking place after final exams and before the start of the next semester. Re-evaluation is estimated to require about 50 hours of effort, including sessions, homework, and evaluation.

Minimum requirements to be eligible for re-evaluation:
- Being enroled in the course
- Having obtained a grade NF between 3.5 and 4.9
- Having taken all course exams (partial and final) during the semester

Requirements to be re-evaluated
- Attend all sessions of the intensive course
- Do the homework and other activities requested by course professors.

Evaluation:
The result of the intensive course evaluation will be "pass" or "fail". The final grade for the course will be:
Final score = 5 if the intensive course score is "pass"
Final score = NF if the intensive course score is "fail"
(where NF is the grade obtained in the regular course evaluation)


GENERAL COMPETENCE

The evaluation of the general competence "Autonomous Learning" is based on 2 collected data related to student performance regarding the lists of problems to deliver during the quarter:

Self-learning effort (E):
Average ratio sumbitted_problem / minimum_required_problems for each exam in the course. It shall be calculated as: E = (E1 + E2 + E3) / 3. The metric is saturated in 2. This measure aims to encourage students to do more exercises than the minimum required for each exam.

Learning planning (P):
Measure distribution in time of deliveries of the problems in required lists. It is calculated as P = (P1 + P2 + ... + Pn) / n
Where:
Pi = -Xi*log(Xi) - (1-Xi)*log(1-Xi), if Xi<0.5
Pi = 1, if Xi>=0.5
where Xi is the percentage of problems presented in the first half of the delivery period of the list (and therefore 1-Xi is the percentage of problems presented in the second half of the period). A low P value indicates tendency to delay effort until the second half of the expected period. A high value indicates a more uniform distribution of the effort, or concentration of the effort in the first half of the period.
This metric aims to encourage students to organize work and distribute exercises in time, following the pace of theory and laboratory sessions.

The grade for the general competence will be:
NP if E <= 0.5 (Not enough exercises presented to evaluate competence)
D if 0.5 C if E>=1 and P * E ​​<= 0.4
B if E>=1 and 0.4

A if E>=1 and P * E> 1

Bibliography

Basic:

Complementary:

Web links

  • Pàgina de la asignatura, on es troben apunts, normes de programació, exàmens de cursos passats i altre material docent. Página de la asignatura, donde se encuentran apuntes, normas de programación, exámenes de cursos pasados y otro material docent. Course homepage, with notes, programming style rules, past edition exams, and other teaching material. http://www.lsi.upc.edu/~pro1/
  • El jutge o avaluador automàtic de programes. El juez o evaluador automático de programas. The judge or automatic program evaluator. https://www.jutge.org
  • Curs de programació impartit a la Stanford University. Encara que el llenguatge de base és Java i no C++, molts conceptes són similars. Programació 1 cobreix, aproximadament, els temes 1 a 5, 8, part de l'11, 12 i part del 14. Curso de programación impartido en la Stanford University. Aunque el lenguaje de base es Java y no C++, muchos conceptos son similares. Programación 1 cubre, aproximadamente, los temas 1 a 5, 8, parte del 11, 12 y parte del 14. Programming course taught at Stanford University. Although the base language is Java and not C++, many concepts are similar. Programming 1 covers, approximately, topics 1 to 5, 8, part of 11, 12, and part of 14. http://www-cs-faculty.stanford.edu/~eroberts/books/ArtAndScienceOfJava/
  • Col·lecció de videos (en castellà) construits per a una altra assignatura de programació pel professor Pau Fernández, del departament. Encara que ni l'estil ni el contingut s'ajusten del tot als d'aquesta assignatura, poden ser un complement útil. El temari de Programació 1 és aproximadament els temes 1 a 13. Colección de videos construidos para otra asignatura de programación por el profesor Pau Fernández, del departamento. Aunque ni el estilo ni el contenido se ajustan del todo a los de esta asignatura, pueden ser un complemento útil. El temario de Programación 1 es aproximadamente los temas 1 a 13. Video collection (in Spanish) built for another programming course by Pau Fernández, also instructor at our department. Although neither the style nor the contents is exactly that of Progrmaming 1, it may be a useful complement. The topics in Programming 1 are those in "temas" 1 to 13. http://minidosis.org/
  • Referència molt completa dels llenguatges C i C++. Referencia muy completa de los lenguajes C y C++. Very complete reference for the C and C++ languages. http://www.cprogramming.com/
  • Una introducció a C++. A diferència de l'assignatura, l'èmfasi és en el llenguatge i menys en els conceptes algorísmics. Una introducción a C++. A diferencia de la asignatura, el énfasis es en el lenguaje y menos en los conceptos algorítmicos. An introduction to C++. Unlike Programming 1, the emphasis is on the lantuage and less on algorithmic concepts. http://www.uow.edu.au/~nabg/ABC/ABC.html

Previous capacities

Secondary school.

Addendum

Contents

No hi ha canvis respecte la informació publicada a la guia docent.

Teaching methodology

No hi ha canvis respecte la informació publicada a la guia docent.

Evaluation methodology

Durant el curs es realitzaran tres proves avaluatòries anomenades P1, P2 i F. Les dues primeres són parcials, mentre que l'última és un final. Cadascuna de les proves avaluatòries té una llista de problemes associada. Per poder-se presentar al P1 i P2 és requisit imprescindible resoldre un nombre mínim de problemes de les seves llistes. A més, resoldre un nombre mínim de problemes de la llista associada a l'examen final F habilita que el valor FF de la fòrmula d'avaluació sigui la nota del final F (en cas contrari, el valor de FF serà No Presentat (NP)). El mínim de problemes de cada llista, el procediment i terminis d'entrega s'estableixen a la pàgina web de l'assignatura. La nota final de l'assignatura s'obté amb la fórmula: max (0,2 * P1 + 0,3 * P2 + 0,5 * FF, F) Un acte avaluatori tindrà nota NP si no s'ha fet cap entrega a cap dels seus problemes. Important: per poder optar a la reavaluació cal obtenir qualificacions diferents a NP en P1, P2 i FF i tenir una nota final superior o igual a 3,5.

Contingency plan

Les activitats docents continuarien de manera virtual amb la màxima normalitat possible.