class DocStock
% file: @DocStock/DocStock.m
isa DocAsset

properties
    NumShares@double = 0;
    SharePrice@double = 0;
        
methods
    function s = DocStock(description, num_shares, share_price)
    % DocStock class constructor. 
        construct s using DocAsset(description, 'stock', share_price*num_shares);
        s.NumShares = num_shares;
        s.SharePrice = share_price;
    end % DocStock
    
    function disp(s)
        DocAsset@disp(s)
        fprintf('Number of shares: %g\nShare price: %3.2f\n',...
        s.NumShares,s.SharePrice);
    end % disp
end % class
