with ada.integer_text_io; use ada.integer_text_io; with ada.text_io; use ada.text_io; procedure sumtoeof is sum: integer := 0; i: integer; begin while not end_of_file loop begin get(i); sum := sum + i; exception when data_error => skip_line; when constraint_error => put_line("You numbers are too large to add."); exit; when others => put_line("unknown exception occurred"); end; end loop; put("Sum = "); put(sum); new_line; exception when end_error => put_line("premature end of file"); when others => put_line("unknown exception occurred"); end sumtoeof;