Skip to content

Commit

Permalink
Solution
Browse files Browse the repository at this point in the history
  • Loading branch information
cementix committed Jan 21, 2025
1 parent b1a3d0d commit beb71c2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/calculateRentalCost.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit beb71c2

Please sign in to comment.