# FUNDAMENTALS OF PROGRAMMING A

## Learning outcomes of the course unit

The main aim of the course is to provide students with the fundamental techniques of imperative programming. The course also aims at providing students with the ability to apply analytical techniques to solve simple practical problems and to translate these solutions into executable programs. Finally, the course develops analytical and abstraction skills and it aims at improving the ability related to the decomposition of problems into sub-problems.

Taking Dublin Indicators into account:

Knowledge and understanding

During the course, the main ideas related to imperative programming are introduced. Particular emphasis is dedicated to the comprehension of algorithmic techniques on which imperative languages rely. Most of the suggested literature is in italian, even though proper english words are used during classes, in order to help students in reading also international scientific papers and books. During the course, students are encouraged to learn fundamentals of programming. Students also acquire adequate knowledge of computers architecture and information representation. Moreover, students are able to comprehend applications of mathematics to computer science.

Applying knowledge and understanding

Acquired theoretical knowledge is applied to solve specific problems, which are typically related to mathematics. During the course, some exercise sessions are dedicated to the solutions of problems. Many solving methods are applied to mathematical and numerical problems and they are presented from an algorithmic point of view. Students are able to use computational instruments as a support to mathematical processes and as a way to acquire new information.

Making judgments

Exercises proposed during classes can be solved individually or in groups and they often can be solved in different ways. Students can compare their approach to the solutions proposed by other students and to the solutions shown during classes. Such comparisons enhance the development of specific skills which are useful to better understand the considered problems.

Communication skills

Discussions during classes and exercise sessions allow students to improve their communications skills. Such discussions concern specific algorithmic techniques to solve the proposed problems and they focus on advantages and disadvantages of the proposed approaches. Students learn to work individually and in groups.

Learning skills

The study of algorithmic techniques and their application to heterogeneous problems help students to improve in-depth comprehension of the topics. Acquired knowledge can be adapted to solve problems which may be different from those specifically seen during classes. Students acquire computational techniques useful to work in groups and autonomously.

## Prerequisites

Basic notions on functions, set theory, and logics.

## Course contents summary

Computer architecture and information representation are introduced in the first part of the course. Then, the fundamental of imperative programming are presented. In particular, the concepts of variable, data type, algorithm, and expression are examined and functions and recursive functions are introduced.

## Course contents

1) Information Representation

- Definition of alphabet, string, language and examples

- Definition of information

- Binary encoding and properties

- Representation of texts

- Representation of sounds

- Representation of images

- Representation of videos

- Redundant encoding

- Huffman encoding and applications

- Representation of integer and rational numbers and base conversion

- Representation of numbers in computers

2) Computers Architecture

- Problems and solutions

- Definition of process, program, algorithm

- Machine hierarchy (hints)

- Computer architecture (CPU, memories)

3) Programming

- Variables and data types

- Assignment and expressions

- Functions and recursive functions

- Selection statements

- Iterative statements

- Flux diagram and pseudocode

- Arrays

- Structs

- File manipulation

- Computational cost of algorithms (hints)

- Pointers (hints)

## Recommended readings

- D. Mandrioli, S. Ceri, L. Sbattella, P. Cremonesi, G. Cugola. Informatica arte e mestiere, McGraw-Hill, 2014.

Additional material:

- Exercises on elly.smfi.unipr.it

- L.J. Aguilar. Fondamenti di programmazione in C++ , McGraw-Hill, 2008.

- R. Miller, D. Clark, B. White, e W. Knottenbel: An Introduction to the

Imperative Part of C++, 1999, disponibile su WEB all'indirizzo http:

//www.doc.ic.ac.uk/~wjk/C++Intro/CourseStructure.html#S

- Notes at http://people.math.

unipr.it/gianfranco.rossi/Teaching/FondProgr/index.html

## Teaching methods

The majority of the course consists in frontal lessons.

## Assessment methods and criteria

The final exam consists in a written test and a programming test. The final grade depends on both tests.