Coronavirus information for applicants and offer-holders

We understand that prospective students and offer-holders may have concerns about the ongoing coronavirus outbreak. The University is following the advice from Universities UK, Public Health England and the Foreign and Commonwealth Office.

Read our latest coronavirus information

MPhys Physics with Astrophysics / Course details

Year of entry: 2021

Course unit details:
Object-Oriented Programming in C++

Unit code PHYS30762
Credit rating 10
Unit level Level 3
Teaching period(s) Semester 2
Offered by Department of Physics & Astronomy
Available as a free choice unit? No

Overview

Object-Oriented Programming in C++

Pre/co-requisites

Unit title Unit code Requirement type Description
Introduction to Programming for Physicists PHYS20161 Pre-Requisite Compulsory

A working knowledge of programming at the level of PHYS20161 and an interest in programming.

Aims

  1. To learn the fundamentals of Object Oriented Analysis and Design.
  2. To become fluent in the C++ programming language.
  3. To develop good programming style.
  4. To be able to apply coding quickly and efficiently to realistic (physics) applications.

Learning outcomes

This course unit detail provides the framework for delivery in 20/21 and may be subject to change due to any additional Covid-19 impact.  Please see Blackboard / course unit related emails for any further updates
On completion successful students will be able to:-
1. Write C++ code that is compact and intelligible
2. Design and write programs in C++ using a wide range of ANSI standard features
3. Locate data structures and algorithms in the standard library to simplify coding
4. Select and use appropriate object-orientation techniques to solve new problems

Syllabus

1. The basic properties of C++: constants; boolean data-types; pointers and references; dynamic memory allocation; function overloading.

2. Data streams: standard input/output; managing files.

3. Classes and objects: encapsulation; access functions; constructors and destructors; arrays of objects; friends; operator overloading; assignment operator; shallow and deep copying; this pointer.

4. Inheritance: base and derived classes; access specifiers; overriding functions; multiple inheritance.

5. Polymorphism: base class pointers; abstract base classes; virtual and pure virtual functions; interface classes.
6. Structuring programs: header files; multiple source files; namespaces.

7. Advanced C++ features: static data; templates; runtime type checking; error handling and exceptions.

8.The C++ Standard Library; the boost library; other libraries.


 

Feedback methods

Feedback will be offered orally by demonstrators in lab-based sessions when they mark lab-based projects. Written feedback will be provided with final project marks.

Recommended reading

A. Koenig and B. E. Moo. Accelerated C++ (Addison Wesley, 2000)
Or any of the many C++ textbooks listed in the library reading list

Study hours

Scheduled activity hours
Lectures 10
Practical classes & workshops 10
Independent study hours
Independent study 80

Teaching staff

Staff member Role
Niels Walet Unit coordinator
Malcolm Gray Unit coordinator

Return to course details