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

add solution #4859

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

add solution #4859

wants to merge 2 commits into from

Conversation

pasha30061
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.

Your solution is on the right track and correctly calculates the rental cost based on the number of days. However, there are a couple of important improvements needed to meet the task requirements fully. Please replace hardcoded literals with descriptive constants to enhance code readability and maintainability. Additionally, simplify your code by removing unnecessary else statements after if with return. These changes will help you adhere to best practices and make your code cleaner and more efficient. Keep up the good work, and I look forward to seeing your improvements! 😊

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

🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review button in the Reviewers tab.

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! 🎉 Your solution correctly calculates the rental cost based on the number of days and applies the appropriate discounts. However, there are a couple of areas for improvement:

  1. Use of Constants: Instead of using literals like 40, 50, and 20 directly in your expressions, it's better to define them as constants with descriptive names. This makes your code more readable and maintainable.

  2. Conditional Logic: It's recommended to avoid using else after an if statement that contains a return. Refactoring this can make your code cleaner and easier to follow.

These adjustments will not only enhance the quality of your code but also help you adhere to best practices. Keep up the good work, and make sure to address these points in future projects to continue improving your coding skills. Remember, learning from feedback is a crucial part of your development journey. 🚀

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

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