--
--Erik Israelsson D1b 871102-1637 "eriis325"
--labb4
--Del B
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;
with labb4;
procedure Labb4 is
--Package handling 'My_Date'
package body My_Date is
procedure Get(Item : out Date_Type) is
Str : String(1..10);
begin
Get(Str);
Item.Year := Integer'Value(Str(1..4));
Item.Month := Integer'Value(Str(6..7));
Item.Day := Integer'Value(Str(9..10));
end Get;
procedure Put(Item : in Date_Type) is
begin
Put(Item.Year);
Put("-");
Put(Item.Month);
Put("-");
Put(Item.Day);
Put("-");
end Put;
end My_Date;
Date : My_Date.Date_Type;
begin
Put("Enter a date of your choice: ");
Get(Date);
New_Line;
-- Date.Year := Integer'Value(Str(1..4));
Put(Date);
end Labb4;