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 #5117

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

Solution #5117

wants to merge 1 commit into from

Conversation

04112Hanna
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 meets the task requirements and constraints effectively. While there is a minor overlap in the discount conditions, it does not critically impact the functionality. Keep up the good work, and consider refining the discount logic to ensure clarity and prevent potential overlaps in the future. 😊

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

Comment on lines +12 to +13
if (days >= 3 && days <= 6) {
return BasePrice * days - ShortTermDiscount;

Choose a reason for hiding this comment

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

The condition days >= 3 && days <= 6 applies a short-term discount for rentals between 3 and 6 days. However, this logic overlaps with the long-term discount condition. Consider revising the conditions to ensure that only one discount is applied for each range of days.

Comment on lines +16 to +17
if (days >= LongTerm) {
return BasePrice * days - LongTermDiscount;

Choose a reason for hiding this comment

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

The condition days >= LongTerm applies a long-term discount for rentals of 7 days or more. Ensure that this condition does not overlap with the short-term discount condition to avoid applying multiple discounts for the same rental period.

Copy link

@4ksandrey 4ksandrey left a comment

Choose a reason for hiding this comment

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

Accepted, well done

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.

3 participants