WEEK4 - Week4 BasicBuildingBlocks Programsandmodules o...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
Click to edit Master subtitle style Week 4 Basic Building Blocks
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Programs and modules o Main program unit program name use statements . . . Specification statements . . . Executable statements . . . end program
Background image of page 2
Programs and modules o Module program unit module name use statements . . . Specification statements . . . contains Procedure definitions .
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Procedures o Divide and rule! Main program Procedure 1 Procedure 2 Procedure 3
Background image of page 4
Procedures o Procedures - origin n “Write your own” (homemade) n Intrinsic (built-in, comes with  F  ) o sin (x), cos (x), abs (x), … n Written by someone else (libraries) o Procedures (subprograms) - form n Functions n Subroutines
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Procedures o The main program and any subprogram need never be  aware of the internal details of any other program or  subprogram! Main program Procedure 1 Procedure 2 Procedure 3
Background image of page 6
Functions function cube_root(x) result (root) ! A function to calculate the cube root of a positive real number ! Dummy argument declaration real ,
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 03/13/2011.

Page1 / 14

WEEK4 - Week4 BasicBuildingBlocks Programsandmodules o...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online