Program P5(Input, Output, Infile, Outfile); { Mel Simmons Program 5 } Var n1, n2:Integer; code:char; Infile, Outfile:Text; Function SumSq(n1, n2: Integer):Integer; Begin {SumSq} SumSq := n1 * n1 + n2 * n2; End; {SumSq} Begin {P5} Assign(Infile, 'c:\p5in.txt'); Reset(Infile); Assign(Outfile, 'c:\p5out.txt'); Rewrite(Outfile); While Not EOF(Infile) Do Begin Readln(Infile, code, n1, n2); Writeln(Outfile, 'Input Data: ', code, n1:5, n2:5); Case code of 's', 'S': Writeln(Outfile, ' The sum of the Squares is ', SumSq(n1, n2)); else Writeln(Outfile, 'Invalid code *', code, '*'); End; End; Close(Outfile); Readln; End. {P5}