function s = toSeconds(hour, minute, second)
%TOSECONDS 24-hour time to seconds after midnight
%  s = toSeconds(hour, minute, second, ampm) returns
%  the number of seconds s after midnight equal to
%  the 24-hour clock time hour:minute:second.
%
%  hour is expected to be in the range 0-23
%
%  minute is expected to be in the range 0-59
%
%  second is expected to be in the range 0-59

% seconds in hour hours
s = hour * 60 * 60;

% add seconds in minute minutes
s = s + minute * 60;

% add second seconds
s = s + second;

end
