package body State is
   procedure Swap (A, B : in out Integer) is
      T : constant Integer := A;
   begin
      A := B;
      B := T;
   end Swap;

   procedure Add_To_Total (Amount : in out Integer) is
   begin
      if Total < 1_000 and Amount in 0 .. 1_000 then
         Total := Total + Amount;
      end if;
      Amount := 0;
   end Add_To_Total;
end State;
