Skip to content

Commit

Permalink
Solution
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegMysko committed Dec 10, 2024
1 parent b1a3d0d commit 9197355
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/calculateRentalCost.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@
* @return {number}
*/
function calculateRentalCost(days) {
// write code here
const rentalCost = 40;

if (days >= 7) {
return rentalCost * days - 50;
} else if (days >= 3) {
return rentalCost * days - 20;
} else {
return rentalCost * days;
}
}

module.exports = calculateRentalCost;

0 comments on commit 9197355

Please sign in to comment.