FUNDAMENTALS OF PROGRAMMING A - FUNDAMENTALS OF PROGRAMMING B
cod. 1000753

Academic year 2022/23
1° year of course - Annual
Professor responsible for the course unit
ARCERI Vincenzo
integrated course unit
15 credits
hub: PARMA
course unit
in ITALIAN

Course unit structured in the following modules:

Learning objectives

A goal of Module A is to provide the student with the basic knowledge for the design and implementation of simple programs written in a conventional programming language. In particular, the student will acquire in-depth knowledge about the programming tools provided by the imperative fragment of C++.

Module A also aims to provide students with the ability to apply the acquired knowledge about programming tools and the acquired problem analysis techniques to solve simple practical problems (such as, for example, mathematical calculation problems, sorting, file management, etc.) and then translate these solutions into executable programs.

Finally, Module B aims to help students to develop more general skills of analysis, abstraction (mainly intended as the ability to describe and understand an entity in terms of the features rather than the details of its implementation), the decomposition of problems into subproblems, and development of solutions "from top to bottom" ("top-down") and by stepwise refinements.

Module B aims to provide the student with the basic knowledge for the design and implementation of "object-oriented" programs, as well as in-depth knowledge about the programming tools provided by C++ and Java for "object-oriented" programming.
 
Module B also aims to provide students with the ability to apply the acquired problem analysis techniques and knowledge about programming tools to carry out concrete executable C++ and Java programs.

Prerequisites

Basics of functions, sets and logical connective and expressions. Basics of computer architecture and information representation.

Course unit content

Module A introduces the basics of imperative programming, using the imperative fragment of C++ as the reference language.

In particular, the first part of Module A introduces basics of programming such as algorithms, flowcharts, variables, simple and structured data types, expressions, and control statements.

The second part of Module A deals with the development of more complex programs, introducing, on the one hand, the notion of sub-program and other related concepts, such as recursive functions and scope rules, on the other hand, other forms of data management, such as files and manipulation of dynamic data structures with pointers.

For both parts, the course shows the implementation of simple C++ programs that use the introduced concepts.

Module B introduces the fundamentals of the "object-oriented" and modular programming paradigms, using as the main reference the C++ language, but also taking into account the Java language in the final part of the course.

Module B also presents some advanced constructs and mechanisms of C++ and Java, such as function and operator overloading and exception handling, as well as some notions and tools that are not strictly related to the "object-oriented" programming paradigm, but which are nevertheless of great importance, such as the notions of abstract data type and the software development cycle.

Full programme

FOUNDAMENTALS OF PROGRAMMING A.

- Problems and algorithms: basic notions, flow-charts.
- Programming languages and tools. A sample program in C++.
- Constants and variables.
- Elementary data types in C++.
- Assignment and compound statements - Basic input/output.
- Operators and expressions.
- Control structures (selection, iteration).
- Data structures (abstract vs. concrete). Arrays in C++. Matrices. Strings. 'struct'. Tables.
- The 'typedef' declaration.

- Subprograms: motivations. Function declaration and call in C++.
- Parameter passing: by value, by reference.
- 'void' functions.
- Recursive functions.
- Scope rules in C++. Local vs. global declarations.
- File management in C++.
- Pointers and dynamic memory allocation. Simple linked lists.

- Program development. Integrated Development Environments.
- Developing simple programs using the imperative part of C++.
- Using library functions.

FOUNDAMENTALS OF PROGRAMMING B.

Class and object declaration. Accessing member functions and data of a class. Class constructors. Abstract data types (ADT).
A sample class: 'rational'
Function and operator overloading.
The 'string' class.
Dynamic memory allocation. A sample class: 'int_vett'. The assignment operator. The copy constructor. Class destructors. Object life-time.

Exception handling: motivations. Constructs for exception handling in C++.
Parametric classes ('template'): declaration, instantiation. A sample class: 'vett<T>' - Parametric functions.
Inheritance. 'public' vs 'private' derivation. Multiple inheritance (hints).

Introduction to Java. Features and components. Interpretation vs compilation. The Java Virtual Machine. Structure of a Java program.
Simple primitive types. Basic I/O. Control stuctures.
Structured types: arrays. References and objects. Garbage collection. Strings. Static methods. Parameter passing.
The 'class' construct. Declaration and instantiation. Example: class 'Rational'.
Inheritance. Example: classes 'Rectangle' and 'Square'. References 'this' and 'super'. Polymorphism. Substitution principle and "down-casting". Classe hierarchy (class java.lang.Object).
"Wrapper" types.
Interfaces and implementations. Interfaces and inheritance.
Graphic Interface (GUI) in Java. AWT and Swing. Windows (class 'JFrame'). Layout Manager. Panels (class 'JPanel'). Events and Listener. Interface 'ActionListener'.

Bibliography

- 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

- Teacher lecture notes, available on the Web at http://people.math.unipr.it/gianfranco.rossi/Teaching/FondProgr/index.html

- C++ programs shown in class and in the laboratory, available on the Web at http://people.math.unipr.it/gianfranco.rossi/Teaching/FondProgr/EsempiLezione/index.html and http://lea.unipr.it/course/view.php?id=324

- C.S. Horstmann , Concetti di informatica e fondamenti di Java, Apogeo, 2010.

- M.Cadoli, M.Lenzerini, P.Naggar, A.Schaerf. Fondamenti della progettazione di programmi. Principi, tecniche e loro applicazioni in C++, CittaStudiEdizioni di UTET Libreria, 1997.

Teaching methods

Teaching takes place mainly through lectures and computer-based exercises, either assisted or carried out independently by the students.

The lectures provide, among other, the presentation of a number of practical examples, along with the related solutions written in C++ and Java, that will be made available on the Parma University e-learning platform Elly (https://elly2022.smfi.unipr.it/)

The exercises provide the assignment, every week, of one or more exercises related to the topics covered in class. The student will have to solve the exercises independently and deliver solutions within a week, using the Parma University e-learning platform Elly (https://elly2021.smfi.unipr.it/). The platform allows, among other, the teacher to monitor the delivery of the exercises carried out and to provide suggestions for their implementation.

Physical meetings with the teacher are scheduled, on a weekly basis, for all those students who have difficulties in achieving the assigned exercises.

Assessment methods and criteria

The final examination of the course consists of a written theory test and a written programming test for Module A and a written theory test and a written programming test for Module B.

A theory test consists in answering on paper ten closed questions on the most basic and general topics treated throughout the course. This test serves as a barrier to the second programming test. To pass the theory test and access the programming test, 70% of the questions are required to be answered correctly. If the student does not correctly answer at least 70% of the questions, the exam is considered not passed, and will not be able to access the programming test.

The programming test consists in the solution on paper of some programming exercises.

Fundamentals of programming A +B: A mark out of thirty is assigned to each module (module A and module B). The exam of Fundamentals of Programming A + B is considered passed if the arithmetic average between the grade obtained in Fundamentals of Programming A and that obtained in Fundamentals of Programming B is greater than or equal to 18 and each of the two grades is greater than or equal to 16.

There will be an "in itinere" test (not mandatory) which will be held in the months of January to February of the current academic year. The test is reserved to students of the first year that have solved and delivered at least the 70% of the exercises assigned during the course.
The "in itinere" test replaces the normal written test of Module A.

Other information

- - -