% -----------------------------------------------------
% semestersoftheyear.m
% -----------------------------------------------------
% Write a program that asks the user to input the month as a number (1-12),
% checks what semester the month belongs to and displays the semester. 
% -----------------------------------------------------
% Notes: This program can also be written using if-else statements. 
% -----------------------------------------------------
% Copyright and license details available at matlabmarina.com
%------------------------------------------------------

clear;
clc;

% read in month from the user
month = input('enter a month (1-12): ');

% check what semester the month falls under
 switch month
     case {1 2 3 4 5}
         disp('Spring');
     case {6 7}
         disp('Summer');
     case {8 9 10 11 12}
         disp('Fall');
     otherwise
        disp('error, bad month index')
 end 
