Details of C/C++ course 3C59

 

Draft 5: Revised 18/11/2000 printed: 08/01/01

 

Title:

Scientific Programming using Object Oriented Languages

 

Aims of the course

The aim of this course is to give the student an introduction to the use of object oriented programming in the context of physics data handling and analysis situations .

Implementation is mainly in C++. Through this course the student should learn enough to be able to design and implement simple analysis programs such as would arise in 3rd year laboratories and 3rd and 4th year project work.

In addition the course also aims to give an introduction to the use of Java if time permits.

 

Objectives

The specific objectives of the course are that the student will become familiar with

 

 

Module and syllabus summary

Module

Theme

Basic modules

1

Inbuilt data types (int, float, char...)

Manipulations of inbuilt data types

Simple functions

2

User defined data types ( classes )

Objects as instances of a class

Manipulation of object member variables

Operations on objects: Methods

Data encapsulation

3

Algorithm steering elements

(if, switch, for, while, do)

4

I/O

-Screen and keyboard: cin >>, cout <<

- File i/o

5

Handling collections of objects:

-An introduction to the vector class

Consolidation exercise1 - part 1:

Formulating the first few classes of the Compton analysis problem

Technical

Some technical topics:

  • code organisation into .h and .cpp files
  • the C pre-processor
  • references
  • const variables and references
  • scope

7

Constructors and Destructors

Consolidation exercise1 - part 2:

Completing the Compton analysis program

Technical

Pointers

- pointers

- allocation of memory with new and delete

- the important use of destructors

- this->

8

More on methods:

- overloading of methods

- self messaging

- const methods and arguments

9

Operator overloading

Consolidation exercise2

Design and implementat of a Monte Carlo program to simulate the Compton scattering experiment

Technical

Some more Technical topics:

- more scope (nested types)

- namespaces

- typedef

10

Inheritance

11

Polymorphism and vitual methods

12

The String class

Advanced modules

20

(16old)

STL-1

- Containers: (vector, list....)

- Iterators

21

Template classes

22

STL-2

- Use of generic algorithms on STL containers

- The map container

23

Interface programming

24

Type conversion

- via constructors

- via conversion operators

- casting

- implicit conversion

Advanced modules (not in 2000/01)

25

Exception handling

26

Design Patterns

Design Modules

D1

Towards Object Oriented thinking

Classes are more than for just data entities

D2

(old4)

Formal Object Oriented analysis and design

Java Modules

J1

Introduction to Java

 

 

Module and syllabus details

Details of the aims of each module, and the material covered by each can be found in:

 

OOCoourse_details.pdf