Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Code Challenge: Snacky Friends, a donkey, and Apples
#1
You'll find my solution for this challenge (coded with BAM) here.

The gist of the challenge:

Quote:Once upon a time, 3 friends bought apples and carried them on a donkey.
When night came, they decided to sleep in the forest.

The first friend woke up hungry at midnight, so he divided the apples into three equal shares.
The one extra remaining apple, he gave it to the donkey.  He then ate his share and went back to sleep.

A while later, the second friend woke up hungry, so he divided the remaining apples into three equal shares.
The one extra remaining apple, he gave it to the donkey.  He then ate his share and went back to sleep.

A while later, the third friend woke up hungry, so he divided the remaining apples into three equal shares.
The one extra remaining apple, he gave it to the donkey.  He then ate his share and went back to sleep.

In the morning, the 3 friends woke up hungry, so they divided the remaining apples into three equal shares.
The one extra remaining apple, they gave it to the donkey.  They then ate each of their share.

How many apples did they initially buy, and how many apples did each of them eat?
Reply


Messages In This Thread
Code Challenge: Snacky Friends, a donkey, and Apples - by CharlieJV - 08-04-2024, 02:12 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Challenge for you... eoredson 61 13,247 01-11-2026, 03:48 AM
Last Post: bplus
  Correcting the code Chris 15 3,311 10-28-2023, 09:48 PM
Last Post: SMcNeill
  Summer LASER Challenge TerryRitchie 42 9,152 07-30-2023, 06:57 PM
Last Post: bplus

Forum Jump:


Users browsing this thread: 1 Guest(s)