diff --git a/src/calculateRentalCost.js b/src/calculateRentalCost.js index 1e3a27d11..3813a1eff 100644 --- a/src/calculateRentalCost.js +++ b/src/calculateRentalCost.js @@ -4,7 +4,17 @@ * @return {number} */ function calculateRentalCost(days) { - // write code here + const total = days * 40; + + if (days >= 7) { + return total - 50; + } + + if (days >= 3) { + return total - 20; + } + + return total; } module.exports = calculateRentalCost;