tetha
unread,Sep 5, 2010, 2:26:50 AM9/5/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
  to coding kata
Greetings,
it appears that the test suite of the Movie Tickts exercise is lacking
some interesting edge cases.
For example, think of 19 students and 2 children. In this case, the
lowest average price is achieved if we ticket one groupe of 20 persons
(19 students + 1 child) and 1 child (because this lowers the price for
19 peoples from $8 to $6 and raises the price from $5.50 to $6 only).
Second, for a group of 20 or more old people, it actually is better to
not apply the group price on thursdays, because this will enable them
the movie day discount, lowering the average ticket price.
There are some solutions which can solve the second case, however,
from what I have seen in the java solutions, no solution appears to be
able to handle the first case.
I think a fix would be to either state that "A single purchase must
either be a ticket in its entirety or be not handled as a group at
all", or change the test cases (which will invalidate many solutions
and make the problem quite a bit harder :)
Regards,
Tetha.