The purpose of this exercise is to get you to be familiar with JavaScript in general, unit testing and cryptocurrency arithmetic. In blockchain & cryptocurrency, we are constantly dealing with huge numbers, for example Ether (ETH) with 18 decimal places, this exercise aims to get you familiarized with that.
This exercise should take about 2-3 hours.
Supposedly there's a token sale that sells token X for token Y. For ease of discussion, let's call token X (token for sale), SALE token and token Y (base currency) ETH.