--Constants
package Constants is
  pragma Pure;

  Minimum_Value : constant := -1_000;
  Maximum_Value : constant := 15_000;
  Invalid_Value : constant := Integer'Last;

end Constants;
--Constants

--Datastore
package Datastore is
  pragma Elaborate_Body;

  Object : array (1 .. 100) of Integer;

end Datastore;

with Constants;
with Ada.Text_IO; use Ada.Text_IO;
package body Datastore is

  subtype Valid_Range is
   Integer range Constants.Minimum_Value .. Constants.Maximum_Value;
  Attempt : Integer;
  Count   : Integer := Object'First;

begin

  loop
    Put ("Value: ");
    Attempt := Integer'Value (Ada.Text_IO.Get_Line);
    exit when Attempt not in Valid_Range;
    Object (Count) := Attempt;
    Count          := Count + 1;
  end loop;

  for I in Count .. Object'Last loop
    Object (I) := Constants.Invalid_Value;
  end loop;

end Datastore;
--Datastore

--Main
with Ada.Text_IO; use Ada.Text_IO;
with Constants;
with Datastore;
procedure Main is

begin

  for I in Datastore.Object'First .. Datastore.Object'Last
  loop
    exit when Datastore.Object (I) = Constants.Invalid_Value;
    Put_Line (Integer'Image (I) & " =>" &
              Integer'Image (Datastore.Object (I)));
  end loop;

end Main;
--Main
