Winnie Leung F.4CA (22) HW3(II) ---- BK2 P.17 #5 program amount(input, output); uses wincrt; var n1, n2, n3: real; r1, r2 :string ; a1, a2 :string; ep1, ep2 :integer; begin repeat write('Please enter the first amount: '); readln(a1); if copy(a1,1,1) <>'$' then writeln('Invalid input.') until copy(a1, 1, 1) = '$'; r1 := copy (a1,2,6); repeat write('Please enter the second amount: '); readln(a2); if copy(a2,1,1) <>'$' then writeln('Invalid input.') until copy(a2,1,1) = '$'; r2 := copy (a2,2,6); val(r1, n1, ep1); val(r2, n2, ep2); n3:= n1 + n2; writeln(a1, ' + ', a2, ' = ','$', n3:6:2) end.