Introduction to C++ Programming

Introduction to C++ Programming (IntroC++ | SPA4321)

Please consult QMPlus for the authoritative information on this module.

Year: 1 | Semester: B | Level: 4 | Credits: 15

Prerequisites: None
Lectures: 22 | Lab: 414 415 416 514 515 516 (notation)
Exam: Practical Examinations 3hrs
Practical work: 33 |

Course organiser: Dr Ulla Blumenschein | Course deputy: Dr Jon Hays

Synopsis:
This is an introductory programming module for physicists and no prior programming knowledge is assumed. Students are taught the basics of writing and compiling C++ code within a robust theoretical framework of increasing complexity consisting of: Variables and Data Types, Arithmetic Operators, Simple I/O. Program flow, while statement for-loops, if-statement and logical operators, Formatted Output. Switch Statement; User defined functions (structured programs); Series Evaluation. Casts; References; Introduction to Monte Carlo methods and random number generation; Multi-file programs; File I/O. Arrays and Pointers. Numerical Integration Techniques, Roots of functions, Function Minimization.
Aims:
By the end of this module students will be able to write, compile and run their own programs in C++. The programs will carry out common scientific procedures such as the numerical solution of equations, numerical data analysis and general data file manipulation. This module aims to provide highly transferable programming skills applicable to any quantitative discipline.
Outcomes:
Academic Content The broadest aim of this course is to convert physical problems into functioning C++ computer code. To use C++ code to manipulate numerical data and calculate specific results. To use C++ code to simulate physical examples by using Monte Carlo methods. Disciplinary Skills To convert mathematical statements, such as functions, into C++ code. To write code which prompts the user to enter variable values in order to calculate functions of these variables. To write code which reads data files and manipulates the individual elements of the resulting arrays. To write code which outputs data files, in appropriate formats, from arrays generated within a program To write code which compares variables or array elements and whose output depends on pre determined logical statements. To write code which generates random numbers within a specified distribution. Attributes Use quantitative data confidently and competently Use communication technologies competently Apply their analytical skills to investigate unfamiliar problems Use technologies to access and interpret information effectively

Recommended books:

G.J. Bronson,
`C++ for Engineers and Scientists',
PWS Publishing, (1999).
ISBN: 0-534-95060-4 

Juno Champion

The school holds Juno Champion status, the highest award of this IoP scheme to recognise and reward departments that can demonstrate they have taken action to address the under-representation of women in university physics and to encourage better practice for both women and men.