--  Sample Ada 2012 program — samplefiles.com
with Ada.Text_IO; use Ada.Text_IO;

procedure Sample is
   type Money is delta 0.01 digits 12;

   type Customer is record
      Id      : Positive;
      Name    : String (1 .. 6);
      Balance : Money;
   end record;

   function Is_Vip (C : Customer) return Boolean is (C.Balance >= 10_000.00);

   Customers : constant array (1 .. 3) of Customer :=
     ((1, "Ada   ", 12_500.00),
      (2, "Grace ", 830.50),
      (3, "Linus ", 10_000.00));

   Total : Money := 0.0;
begin
   for C of Customers loop
      Put_Line (C.Name & Money'Image (C.Balance) & (if Is_Vip (C) then " VIP" else ""));
      Total := Total + C.Balance;
   end loop;
   Put_Line ("Total:" & Money'Image (Total));
end Sample;
