Skip to content

Commit

Permalink
Solution
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasQ789 committed Jan 21, 2025
1 parent b1a3d0d commit ee5df54
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/calculateRentalCost.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
*/
function calculateRentalCost(days) {
// write code here

const dailyRate = 40;

if (days < 3) {
return days * dailyRate;
} else if (days >= 3 && days <= 6) {
return days * dailyRate - 20;
} else if (days >= 7) {
return days * dailyRate - 50;
}
}

module.exports = calculateRentalCost;

0 comments on commit ee5df54

Please sign in to comment.