Skip to content
Physics and Astronomy
Home Handbook-pub 07-08 Modules PHY2004.html
Back to top

PHY2004 Scientific Programming in C

2007-2008

Code: PHY2004
Title: Scientific Programming in C
InstructorsDr Suzanne Aigrain
CATS credits: 10
ECTS credits: 5
Availability: unrestricted
Level: 2
Pre-requisites: N/A
Co-requisites: N/A
Background Assumed: IT Skills for Physicists (PHY1108)
Duration: Semester I
Directed Study Time: 11 practical sessions of 2 hours
Private Study Time: 28 hours
Assessment Tasks Time: 50 hours
Observation report: awaiting notification

Aims

A knowledge of a computing language and how to write programs to solve physics related problems is a valuable transferable skill. It is taught though a series of practical sessions in which the students initially learn to understand the logic of the source code and are required to modify the code for a number of prepared projects. There is currently a high demand in many industries to recruit future employees who have a working knowledge of the C programming language. As a result the module now uses C in preference to Fortran, although the principles involved are applicable to almost any procedural programming language.

This module provides a general introduction to programming in C and to the basic elements of ANSI C. It is designed to give students the ability to write simple computer programs in C and to be able to understand such programs written by others. The module covers control structures (loops, if statements, switches), functions and input/output operations which are introduced using simple physics-related problems. The course forms part of a package of computing course given in the School and provides the basic training for those students wishing to take PHY3134 Computational Physics.

Intended Learning Outcomes

Students should be able to:

Module Specific Skills

  • construct flow charts for computer code;
  • write and modify simple programs in ANSI-C;
  • find errors and debug code;
  • use files, keywords, structured programs and the elements which constitute good robust programs;

Discipline Specific Skills

  • apply logic to the solution of problems;
  • keep proper records of work;

Personal and Key Skills

  • deal with the practicalities of writing a computer program.

Transferable Skills

Logical thinking and planning; structured approach to problem solving; familiarity with a professional programming workbench; general computer software literacy; keyboard skills; portfolio presentation of work.

Learning and Teaching Methods

The module is taught as a series of practical workshops in which the student experiences C-programming at first hand using prepared projects and later producing their own. Each class lasts for 2 hours, students are able to work at their own pace. Assistance is provided by the staff to ensure that everyone progresses at a reasonable rate.

Students will practise their programming skills outside formal class sessions, and each week appropriate homework assignments are set to be completed, handed in and assessed. Students are required to prepare two portfolios, each recording the development of a program that represents their computing expertise at that time.

Assignments

Eight weekly homework assignments (4 hours each) to be completed before the end of the week following the class. Produce two portfolios (8 hours each), one to be handed in by the end of week 7, the other at the end of week 11.

Assessment

Weekly homework assignments and classwork (35%), portfolios (2×15%), and a class test (35%).

Syllabus Plan and Content

  1. The Metroworks Integrated Development Environment and C-compiler
  2. ANSI C
    1. The C-compiler
    2. Local and global variables (integers, real, character)
    3. Arithmetic expressions, relational, logical, increment and decrement operators
    4. Input/output (formats, data files, etc.)
    5. Functions and program structure (standard functions, user-defined functions)
    6. Header files
    7. Arrays (strings, multidimensional arrays)
    8. Rounding errors and accuracy considerations
    9. Good programming practice

Core Text

Halpern R.P. (1997), C for Yourself, Oxford University Press, ISBN 0-195-10841-8 (UL: 001.6424/C HAL)

Supplementary Text(s)

Not applicable

Formative Mechanisms

Performance in classwork is monitored throughout and problems discussed with individuals during the class. Advice for better programming is written on homework assignments. Results of the CA tests are discussed with individuals and a summary of common errors given to all students.

Evaluation Mechanisms

The module will be evaluated using information gathered via the student representation mechanisms, the staff peer appraisal scheme, and measures of student attainment based on summative assessment.

                                                                                                                                                                                                                                                                       

Validate   Link-check © Copyright & disclaimer Privacy & cookies Share
Back to top