% m3eP190.m
% Program on page 190.
function total_days = total(month,day,extra_day)
total_days = day;
for k = 1:month - 1
switch k
case {1,3,5,7,8,10,12}
total_days = total_days + 31;
case {4,6,9,11}
total_days = total_days + 30;
case 2
total_days = total_days + 28 + extra_day;
end
end