-- Collection of code snippets by Arne Vajhøj 
-- (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
with Ada.Text_IO,Ada.Integer_Text_IO,Salary;

use Ada.Text_IO,Ada.Integer_Text_IO,Salary;

package body Net_Salary is
    procedure Net_Salary_Create(Amount,Tax : in Integer; Instance : out Net_Salary_Type) is
    
    begin
        Salary_create(Amount, Instance);
        Instance.M_Tax := Tax;
    end Net_Salary_Create;
    
    function Tax(NS : in Net_Salary_Type) return Integer is
    
    begin
        return NS.M_Tax;
    end Tax;
    
    procedure Put(NS : in Net_Salary_Type) is
    
    begin
        Put(Amount(NS),Width=>1);
        Put("(");
        Put(Amount(NS)-NS.M_Tax,Width=>1);
        Put(")");
    end Put;
end Net_Salary;
