with ada.text_io;

with ada.Integer_text_io;

 

procedure oct19 is

type vegetable is (apple, berry, cherry);

i,j,k  : integer;

letter : character;

flag   : boolean;

veggie : vegetable;

pie   : float;

 

--instantiations

package veg_io is new ada.text_IO.enumeration_io (vegetable);

package f_io is new ada.text_io.float_io (float);

 

begin

  pie := 0.21565436;  -- no idea why it woudln’t work before

  PIE := PIE * PIE;

-- pie := pie * 10; -- oct19.adb:21:14: invalid operand types for operator "*"

                    -- oct19.adb:21:14: left operand has type "Standard.float"

                    -- oct19.adb:21:14: right operand has type universal integer

  PIE := PIE * 10.0;       -- this one is legal                              

  i := 19;

  j := 7;

  k := -234;

  k := i/j;

  ada.integer_text_io.put (i, width => 12);

 

  --  FOR I IN 1...10 LOOP

      --   oct19.adb:30:15: numeric literal cannot start with point

      --   tried using ... instead of .. as asked in class  note that

      --   it doesn’t work

 

  FOR I IN 1.. 10 LOOP

     ADA.INTEGER_TEXT_IO.PUT (I);

  END LOOP;

  ada.integer_text_io.put (j,width => 7);

  ada.integer_text_io.put (k, width => 5);

 

  veggie := apple;

  letter := 'a';

  flag := true;

  pie := 0.21565436;

  f_io.put (pie);  -- unformatted output uses - default exponential form

  f_io.put (item => pie, fore => 10, aft =>9, exp => 0); -- formatted output

end oct19;