% program1.m 
% 
% This is an example program in MATLAB.
%
% -Michael Weeks 
% 
% Usage:
%    program1
%

% Give the rate of hourly pay in dollars.
pay_rate = 12.34;

%% 
% hours worked this pay period
hours_worked = 41.0

pay = hours_worked * pay_rate;

disp('For this pay period, your pay is ');
disp(pay);

%{
multiline comments
this is also a comment

%}

%%
% htiewrhgerh lkehrlghelrkghel hvqkdvleqhgwqehg lkerh lkeqhrglk qklheql
% hhjj eghewkjhjewhehoiufhefheo oeoruheor huehovi ewovjqev qeohvouqehvo
% jfdd

% if (hours_worked > 40)
%     disp('You deserve overtime pay.');
% else
%     % nested if statement
%     if (hours_worked < 40)
%         disp('If you work more hours you can get overtime pay.');
%     else
%         disp('You worked exactly 40 hours.');
%     end
% end

if (hours_worked > 40)
    disp('You deserve overtime pay.');
elseif (hours_worked < 40)
    disp('If you work more hours you can get overtime pay.');
elseif (pay > 100)
    disp('We pay you a lot');
else
    disp('You worked exactly 40 hours.');
end

disp('have a nice day');

% Currently, it says:
% For this pay period, your pay is 
%  505.9400
% I would like to say 
% For this pay period, your pay is $505.94

disp(sprintf('For this pay period, your pay is $%6.2f', pay));
