## 90 Pascal User Manual 

representing sequences of person~ ordered by last name. 

Fl,F2, ... , Fm and (;1, G2, ... ,Gn 

such that F (r+l) >= F (I) and; (J+l) >= G (J), for all I, J and merges them into one ordered file 'I such that 

H(K+l) >= H(K) forK = 1, " ... , (M+N-l). program Normalize (DataIn, D, t.aOut) ; { Program 9.1 - Normaliz, a file of measurements generate", as real numbers from an instrume:l- or another program. } type Measurements = file of }~al; Natural = O .. MaxInt; var Dataln, DataOut: MeasurE~ents; Sum, Mean, SumOfSquares, StandardDE :iation: Real; N: Natural; begin Reset (Dataln); N:= 0; Sum := 0.0; SumOfSquares 0.0; while not eof(Dataln) do begin N:= N + 1; Sum := Sum + Datalni; SumOfSquares .= SumOf.5 I~dres + Sqr (Datalni); Get (Dataln) end; Mean := Sum / N; StandardDeviation : = Sqrt ( (,:umOfSquares / N) - ,::qr (Mean) ); Reset (Dataln); Rewrite (Da ,Jllut); while not Eof(Dataln) do begin DataOuti:= (Datalni - l'ean) / StandardDeviation; Put(DataOut); Get (Dat lIn) end end { Normalize }. 

