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

  • Guillem Godoy Balil ( )
  • Pau Fernandez Duran ( )

Others

  • Alexandre Gracia Calvo ( )
  • Alexis Molina Martinez de los Reyes ( )
  • Alfonso Valverde Ruiz ( )
  • Emma Rollón Rico ( )
  • Glyn Morrill ( )
  • Jorge Castro Rabal ( )
  • Lluis Padro Cirera ( )
  • Maria Angela Nebot Castells ( )
  • Montserrat Madridejos Mora ( )
  • Nicolas Mylonakis Pascual ( )
  • Raúl López Sánchez ( )
  • Rosa Maria Jiménez Gómez ( )
  • Xavier Rubiés Cullell ( )

Weekly hours

Theory
2
Problems
0
Laboratory
3
Guided learning
0
Autonomous learning
7.5

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 [Avaluable] - 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.
Objectives: 4 3 9
Contents:
Theory
2h
Problems
0h
Laboratory
3h
Guided learning
0h
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
2h
Problems
0h
Laboratory
6h
Guided learning
0h
Autonomous learning
19.5h

Topic development: Tables

Understand and assimilate the concepts covered in theory classes. Solve the problems set for this topic, available at www.jutge.org.
Objectives: 5 6 7 8 12
Contents:
Theory
4h
Problems
0h
Laboratory
6h
Guided learning
0h
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

Theory
0h
Problems
0h
Laboratory
9h
Guided learning
0h
Autonomous learning
33h

Midterm exam

Several programming exercises should be solved using the jutge.org platform.
Objectives: 1 2 8
Week: 9 (Outside class hours)
Type: theory exam
Theory
2h
Problems
0h
Laboratory
0h
Guided learning
0h
Autonomous learning
0h

Midterm exam

Several programming exercises should be solved using the jutge.org platform.
Objectives: 1 2 4 3 5 7 8 9
Week: 14 (Outside class hours)
Type: theory exam
Theory
3h
Problems
0h
Laboratory
0h
Guided learning
0h
Autonomous learning
0h

Final exam

Several programming exercises should be solved using the jutge.org platform. Global course evaluation
Objectives: 1 2 4 3 5 6 7 8 9 10 11 12
Week: 15 (Outside class hours)
Type: theory exam
Theory
3h
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

There will be homework on a regular basis all along the course, consisting of delivering through judge solutions to specific exercises. The overall mark arising from the homework will be worth a 15% of the subject global mark. Students can take advandage of lab sessions to ask questions about the homework exercises.

Also, two exams will take place during the course: the mid-term exam and the final exam. Let's call D, P and F the marks out of 10 obtained from the homework, the mid-term exam and the final exam, respectively. The subject global mark is obtained as follows:

N = 0.15 * D + 0.85 * max ((0,4 * P + 0,6 * F), F)

An exam will have NP grade if no submission has been made to any of its problems.
The subject global grade N will be NP if both mid-term and final exams have NP grade.

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 global grade between 3.5 and 4.9

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 = N if the intensive course score is "fail"
(where N is the grade obtained in the regular course evaluation)


GENERAL COMPETENCE

The evaluation of the general competence "Autonomous Learning" is based on A=min(D,1.5*N) and will be:

NP if the subject grade N is NP or the amount of delivered homework is less than a 50% of the total. Otherwise:
D si 0 <= A < 5
C si 5 <= A < 7
B si 7 <= A < 9
A si 9 <= A <= 10

Bibliography

Basic:

Complementary:

Web links

  • 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/
  • 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://pro1.cs.upc.edu/
  • 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/
  • 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
  • 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

Previous capacities

Secondary school.