Imperative Programming
Keywords |
Classification |
Keyword |
OFICIAL |
Computer Science |
Instance: 2020/2021 - 1S
Cycles of Study/Courses
Teaching language
Portuguese
Objectives
To introduce the basic principles and concepts of imperative and structured programming, based on the C programming language.
The goal is that students get familiar with the algorithmic problem-solving process and simple algorithms and data structures (for counting, searching and sorting) and gain experience in applying them to the design medium scale computer programs, and acquire good programming skills.
Learning outcomes and competences
After completing this course, students are expected to:
- know the semantics of fundamentals building blocks of the C programming language;
- be able to simulate the step-by-step execution of small programs;
- be able to write, compile and test programs that solve simple programming problems given an informal natural language specification;
- know some basic algorithms for numeric computation, counting, searching and sorting;
- aquire basic abilities in structured programming.
Working method
Presencial
Pre-requirements (prior knowledge) and co-requirements (common knowledge)
N/A
Program
Introduction to the C programming language. Brief historical context. Caracteristics of the language. Strengths and weaknesses of C. Pitfalls and general guidelines in effective use of the language.
Fundamentals of the C language. Basic syntatic structure: directives, declarations, expressions. Compilation and execution.
Basic types (integers, floating point numbers and characters). Flow of control. Cycles. Definition functions. Fomated I/O.
Elementary numerical and semi-numerical algorithms (e.g. Euclid's method for gcd, computing powers, bisection method for root finding)
Indexed variables. Fundamental algorithms: counting, searching and sorting. Processing character strings.
Program organization: header files, standard libraries.
Error detection and prevention. Use of a "debugger" and assertions.
Introduction to programming with pointers. Using pointers to process strings and indexed variables.
Recursion. Algorithmic problem solving: iterative and recursive approaches.
Definition of new data types (structs).
Mandatory literature
000002544. ISBN: 0-393-96945-2
Complementary Bibliography
Thomas H. Cormen;
Introduction to algorithms. ISBN: 978-0-262-03384-8
Kernighan Brian W.;
The C programming language. ISBN: 0-13-110163-3
Jon Bentley;
Programming pearls. ISBN: 9780201657883
Teaching methods and learning activities
Lectures: oral presentation supported by slides; interactive resolution of illustrative programming examples and complementary exercises.
Laboratory classes: solving proposed exercises using computer with standard develpment tools (text editor, compiler, debugger). Use of a custom-set automatic test system to aid detecting and correcting errors in solutions of selected exercises.
Use of automatic evaluation tools: Mooshak and Codex.
https://mooshak.dcc.fc.up.pt/~pi/
https://codex.dcc.fc.up.pt/cc1003/
Software
Codex
Mooshak
gdb - gnu debugger
gcc - gnu c compiler
GNU emacs
Evaluation Type
Distributed evaluation without final exam
Assessment Components
designation |
Weight (%) |
Exame |
80,00 |
Teste |
20,00 |
Total: |
100,00 |
Amount of time allocated to each course unit
designation |
Time (hours) |
Frequência das aulas |
56,00 |
Estudo autónomo |
56,00 |
Trabalho laboratorial |
50,00 |
Total: |
162,00 |
Eligibility for exams
Not applicable in 2020/21.
Calculation formula of final grade
The classification is given by the following components:
T1: intermediate test
T2: second test during the exam period
F: final mark
The final mark is: F = T1*0.20 + T2*0.80
Exams for frade grade improvement and special needs are marked for 100% of the final grade.
Classification improvement
Students can improve the final exam mark in accordance with the general regulations.