Main()

#define RATE = 33.3
float *holding, *activity, *net, tax
int rcount, tcount

1. Show page table

rcount = Load( holding, "holdings" )
3. Show page table

tcount = Load( activity, "transactions" )
5. Show page table

Allocate( net, rcount)
6. Show page table

Update( holding, activity, net )
8. Show page table

tax = Tax( net, RATE )
10. Show page table

Print( holding )
12. Show page table

Print( net )
14. Show page table

Exit

Load( &Array, Fname )

Open Fname

// Read 1st record of file to determine number of entries
count = read( Fname )

// Allocate memory to hold records to be read in. At this
// point, the memory for the array will be placed in a real
// memory frame.
Allocate( Array, rcount )// Allocate is system call

While ( Not = EOF )
    Read Fname into Array[i]
EndWhile

2. & 4. Show page table

Return (count)

Tax( &net, float rate )

float tax;

For each entry in net
  tax += net[ndx]
EndFor

9. Show page table

tax = tax * rate

Return( tax )

Update( &holding, &activity, &net )

For each entry in holding
  net[ndx]=holding[ndx] // duplicate
End_for

// Update holdings For each entry in activity
  holding[id] += activity[id]
End_for

// Calculate change in holdings For each entry in holding
  net[id] = holding[id] - net[id]
End_for

7. Show page table

Print( &Array )

For all entries in Array
    Stylishly print entry
EndFor

11 & 13. Show page table

Return