with ada.text_io; use ada.text_io;
with ada.integer_text_io; use ada.integer_text_io;
with ada.float_text_io; use ada.float_text_io;
procedure e4 is
type employee_record is record
name: String(1 .. 20);
id: String(1 .. 6);
salary: float;
end record;
type emp_rec_array is array(1 .. 100) of employee_record;
procedure get(myemps: out emp_rec_array; c: out Natural) is
e: employee_record;
begin
skip_line;
c := 0;
while not end_of_file loop
c := c + 1;
get(e.name);
get(e.id);
get(e.salary);
myemps(c) := e;
end loop;
end get;
procedure put(myemps: emp_rec_array; c: Natural) is
e: employee_record;
begin
for i in reverse 1 .. c loop
e := myemps(i);
if e.salary > 100_000.0 then
put(e.name);
put(e.id);
put(e.salary, fore=>9, aft=>2, exp=>0);
new_line;
end if;
end loop;
end put;
emps: emp_rec_array;
count: Natural;
-- emps: array(1 .. 100) of employee_record;
begin
get(emps, count);
put(emps, count);
put_line("all done");
end e4;