Advertisement
obernardovieira

Get Zodiac Sign name by birthday date

Nov 20th, 2014
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.61 KB | None | 0 0
  1. birthday = input('Insert your birthday date in format dd-mm: ', 's')
  2. dm = strsplit(birthday, '-')
  3. day = str2num(cell2mat(dm(1,1)))
  4. month = str2num(cell2mat(dm(1,2)))
  5.  
  6.  
  7. switch month
  8.     case 1
  9.         if day > 19
  10.         fprintf('Aquarius')
  11.     else
  12.         fprintf('Capricorn')
  13.     end
  14.     case 2
  15.         if day > 18
  16.         fprintf('Capricorn')
  17.     else
  18.         fprintf('Pisces')
  19.     end
  20.     case 3
  21.         if day > 20
  22.         fprintf('Pisces')
  23.     else
  24.         fprintf('Aries')
  25.     end
  26.     % Well, i'm too busy to do all of them ... Then i will do with a better way. This is the first time i tried
  27.     otherwise
  28.        fprintf('Not a god month');
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement