function [V, S, d] = main(gType, a, b, c)
%% documentation should be here!!

V = NaN; S = NaN; d = NaN;
switch gType
    case 'cuboid'
        if nargin == 4
            [V, S, d] = cuboid(a, b, c);
        else
            fprintf('Wrong input!');
        end
    case 'cylinder'
        if nargin == 3
            [V, S, d] = cylinder1(a, b);
        else 
            fprintf('Wrong input!');
        end
    otherwise, disp('Bad input.');
end
end

function [V, S, d] = cuboid(a, b, c)
    V = a*b*c;
    S = 2*(a*b+a*c+b*c);
    d = sqrt(a^2+b^2+c^2);
end

function [V, S, d] = cylinder1(r, h)
    V = pi*r^2*h;
    S = 2*pi*r*(r+h);
    d = sqrt(h^2 + 4*r^2);
end