$ TADA ARRAY3 Opening array3.text 1: -- SAMPLE TO DEMONSTRATE SIMPLE ARRAYS 3 of 4 2: -- add an internal procedure to print the array 3: 4: with TEXT_IO ; use TEXT_IO , FLOAT_IO ; 5: 6: procedure MAIN is 7: 8: BALANCES : array ( 1..20 ) of FLOAT ; 9: OPEN_ACCOUNTS : INTEGER := 0 ; 10: AMOUNT : FLOAT ; 11: 12: procedure PRINT_BALANCES is -- internal procedure. Note is is located 13: -- in the specification part of the 14: -- outer procedure after object declarations 15: begin 16: for I in 1..OPEN_ACCOUNTS loop 17: PUT(BALANCES(I)) ; PUT_LINE("") ; 18: end loop ; 19: end ; 20: 21: begin 22: loop 23: GET(AMOUNT); 24: OPEN_ACCOUNTS := OPEN_ACCOUNTS + 1 ; 25: BALANCES(OPEN_ACCOUNTS) := AMOUNT ; 26: end loop ; 27: exception 28: when END_ERROR => 29: PUT_LINE(" END OF DATA") ; 30: PRINT_BALANCES ; -- call on internal procedure 31: PUT_LINE(" DONE"); 32: end MAIN ; Compilation complete Syntax errors: 0 Semantic errors: 0 Lines compiled: 32 $ TRUN ARRAY3 END OF DATA 3.5000000E+00 4.1999998E+00 6.6999998E+00 DONE