Module Description

PHY2027 Scientific Programming in C

2011-2012

Code: PHY2027
Level: 2
Title: Scientific Programming in C
InstructorsDr J.M. Rowe
CATS Credit Value: 15
ECTS Credit Value: 7.5
Pre-requisites: N/A
Co-requisites: N/A
DurationT1:01-11
Availability: unrestricted
Background Assumed: -

Total Student Study Time

150 hours, to include: 16×1-hour lectures; 6×3-hour and 5×2-hour supervised computer labs; 48 hours directed self-study and project work; 58 hours private study.

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 student will initially learn to understand the logic of the source code and are required to modify the code for a number of prepared projects. This module yeaches the C programming lanaguage, but the principles involved are applicable to almost every procedural programming language.

This module provides a general introduction to programming in C and to the main elements of ANSI C. It is designed to give students the ability to write clearly structured, debuggable and maintainable computer programs in C and to be able to understand such programs written by others.

Intended Learning Outcomes

Students will be able to:

  1. Module Specific Skills:
    1. construct flow charts for computer code;
    2. write and modify simple programs in ANSI-C;
    3. find errors and debug code;
    4. use files, keywords, structured programs and the elements which constitute good robust programs;
    5. apply the principles of designing and writing debuggable and maintainable computer programs;
    6. design and code data structures that reflect the problems;
    7. write appropriately structured code based on short routines with a clear purpose and interfaces that are simple and unambiguous;
    8. explain and use standard features of the C programming language including structures, pointers and simple memory management;
  2. Discipline Specific Skills:
    1. apply logic to the solution of problems;
    2. keep proper records of work;
    3. apply the C programming language to simple physical problems;
    4. present a portfolio of work.
  3. Personal Transferable Skills:
    1. deal with the practicalities of writing a computer program;
    2. think and plan in a logical manner;
    3. apply a structured approach to problem solving;
    4. make straightforward use of a professional programming IDE.

Learning / Teaching Methods

Lectures, e-Learning resources (ELE PHY2027), and problems classes.

Assessment and Assignments

ContributionAssessment/AssignmentSize (duration/length)When
40%Four homework assignments8-hours eachTwo-week intervals
10%Theory test30 minutesWeek T1:11
30%Practical test1 hourWeek T1:11
20%Project16-hoursFriday Week T1:11

Syllabus Plan and Content

  1. Introduction
    Brief historical survey.
  2. ANSI C
  3. The Xcode Integrated Development Environment and C-compiler
  4. Local and global variables (integers, real, character)
  5. Arithmetic expressions, relational, logical, increment and decrement operators
  6. Input/output (formats, data files, etc.)
  7. Functions and program structure (standard functions, user-defined functions)
  8. Header files
  9. Arrays (strings, multidimensional arrays)
  10. Rounding errors and accuracy considerations
  11. Good programming practice
  12. Program design
  13. Data design
  14. Functions
    1. Variables and scope.
    2. Initialisation.
    3. Function Prototypes.
  15. Memory
    1. Pointers
    2. Arrays
    3. Memory allocation
  16. Structures
    1. Pointers to structures
    2. Using structures to pass data between functions
    3. Linked lists
  17. Projects
    A number of projects based upon the Stage 2 physics course. The background physics required for each project is provided for the student in the project description.

Core Text

McGrath M. (2002), C Programming in Easy Steps (3rd edition), Computer Step, ISBN 1-840-78203-X (UL: 005.133 MCG)

Supplementary Text(s)

Kernighan B.W. and Richie D.M. (1988), The C Programming Language (2nd edition), Prentice Hall, ISBN 0-13-110362-8 (UL: 001.6424/C KER)
Oualline S. (1997), Practical C Programming (3rd edition), O'Reilly, ISBN 1-565-92306-5 (UL: 005.133 OUA)

IOP Accreditation Compliance Checklist

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 Share