81784 - Computer Programming in Physics (A-L)

Academic Year 2024/2025

  • Moduli: Francesco Giacomini (Modulo 1) Carlo Battilana (Modulo 2)
  • Teaching Mode: Traditional lectures (Modulo 1) Traditional lectures (Modulo 2)
  • Campus: Bologna
  • Corso: First cycle degree programme (L) in Physics (cod. 9244)

    Also valid for First cycle degree programme (L) in Physics (cod. 9244)

Learning outcomes

This course would give students a knowledge of the C++ programming language sufficient to face and solve simple problems in Physics through computer programs. In particular the student would become able to perform any operation of data reading and writing, both in text and binary formats, and to use them according to the needs involved in carrying on physical experiments.

Course contents

Elements of computer architecture and operating systems

Machine languages and high-level programming languages

Why C++

Objects, types, variables, literals

Manipulating objects through expressions

Structuring a program through statements

Definition and use of functions

Definition of new types

Input/output system

Generic programming

Dynamic memory allocation

The C++ Standard Library: containers and algorithms

Dynamic polymorphism (a.k.a. object-oriented programming)

Preventing and managing errors

Elements of concurrency and parallelism

Elements of software engineering and supporting tools

Readings/Bibliography

As gentle introduction to C++: B. Stroustrup, A tour of C++

As reference: C++ reference

Suggested textbook: B. Stroustrup, Programming: Principles and Practice Using C++, 2nd edition, Addison-Wesley

Alternatively: B. Stroustrup, The C++ Programming Language, 4th edition, Addison-Wesley

Additional online resources will be communicated during the lectures.

Teaching methods

Lectures (in Italian) and training in laboratory (mandatory)

Assessment methods

The exam is in two parts:

  1. a project concerning the development of a C++ program following the instructions given during the lessons. The project is developed in part during the laboratory sessions, in part autonomously
  2. an oral exam including a discussion about the project and questions about theory and practice of programming in C++ based on what presented during the lectures.

An evaluation of "sufficient" for the project is needed to access the oral exam.

More details are available on Virtuale.

Teaching tools

The presentation and the examples shown during the lessons are available in a Git repository (tba).

Office hours

See the website of Francesco Giacomini

See the website of Carlo Battilana

SDGs

Quality education Industry, innovation and infrastructure Responsible consumption and production

This teaching activity contributes to the achievement of the Sustainable Development Goals of the UN 2030 Agenda.