Re: A Teaser Solving Program
- Posted by Matt Lewis <matthewwalkerlewis at ?mail.co?> Oct 08, 2007
- 488 views
Tristen Wilson wrote: > > Would it be possible to write a simple program to solve this? > > Three students checked into a hotel and paid the clerk $30 for a room > ($10 each). When the hotel manager returned, he noticed that the clerk > had incorrectly charged $30 instead of $25 for the room. The manager > told the clerk to return $5 to the students. The clerk, knowing that the > students would not be able to divide $5 evenly, decided to keep $2 and > to give them only $3. > > The students were very happy because they paid only $27 for the room ($9 > each). However, if they paid $27 and the clerk kept $2, that adds up to > $29. What happened to the other Dollar? > What is it that you would want the program to do? Point out the flaw in the text? This is an old "brain teaser" that uses a false statement to confuse the listener. Assuming that you're really asking what the answer is, then it's that they didn't pay $27. They paid $25 for the room, and the clerk "split" the change with them. The hotel got $25, the clerk got $2, and they kept the other $3. Matt