next up previous contents
Next: Input and Output Up: A quick tour of Previous: Application to DO loops:   Contents


  1. write a program that reads in the radius and computes the area of a circle;
  2. extend the program to test whether the area is negative; if so just STOP. This introduces IF blocks, and logical expressions;
  3. extend the program to read 5 radii; this introduces a DO loop and integer variables; CYCLE and EXIT.
  4. extend the code to first read all 5 radii and then compute all 5 areas; this introduces arrays. The dimension (N=5) is a PARAMETER.

Adrian Sandu 2001-08-26