Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution #5113

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Solution #5113

wants to merge 1 commit into from

Conversation

Vovanchu
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job on implementing the calculateRentalCost function! 🎉 The code is well-structured, with clear variable names and the use of constants, which makes it easy to read and maintain. While there was a minor logical error in the conditional statements regarding the medium-term discount, it doesn't critically impact the overall functionality. Keep up the good work, and consider adjusting the condition to avoid overlapping with the long-term discount for even more accurate calculations. Happy coding! 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨


if (numberOfDays >= LONG_TERM) {
return oneDayRent * numberOfDays - 50;
} else if (numberOfDays <= LONG_TERM && numberOfDays >= SHORT_TERM) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition numberOfDays <= LONG_TERM is incorrect for the medium-term discount. It should be numberOfDays < LONG_TERM to avoid overlapping with the long-term condition. The current condition includes the case where numberOfDays is equal to LONG_TERM, which should only apply to the long-term discount.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants