12 days of Christmas

Happy Christmas everyone! I am sure you are all wondering how many presents you will get this year. This program will tell you how many presents you will get from your "true love" according to the song The Twelve Days of Christmas.


      

      repeat
        print''"For how many days did your true love"
        print"send you presents this christmas?"
        input"> " n%
      
        s% = ((n%/6)*(n%+2)*(n%+1))
       
        print'"You got "str$(s%)" present"+fn_plural(s%)+" in total"
      until false
     
     
     
      deffn_plural(num%)
      rem pass a number - num
      rem returns "s" when num is not 1
      local a$
      if num%=1 then
        a$ = ""
      else
        a$ = "s"
      endif
      =a$