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

Develop #4881

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

Conversation

DmytroPAvlichenko
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 almost there, but there are a few critical improvements needed before we can approve it. 🚀

  1. Use of Literals in Expressions: Replace hardcoded literals like 40, 20, and 50 with constants. This will make your code more readable and maintainable.

  2. Descriptive Names: The variable lease should be renamed to something more descriptive, such as DAILY_RENTAL_COST, to better convey its purpose.

These changes will enhance the clarity and maintainability of your code. Keep up the great work, and I look forward to seeing your improved solution! 😊

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

Review Summary

Great job on implementing the calculateRentalCost function! 🎉 Your code meets the task requirements and constraints effectively. Here are some points to consider for improvement:

  • Typo in Constant Name: The constant PRICCE_FOR_DAY is misspelled. Correcting it to PRICE_FOR_DAY will enhance clarity and prevent potential confusion in larger codebases.

  • Descriptive Naming: While your variable names are descriptive, consider refining them for even greater clarity, especially the discount-related constants.

  • Code Structure: Your use of const for variable declarations is excellent, ensuring that values remain unchanged unintentionally. The control flow is also well-structured, avoiding unnecessary else statements.

Your logic for calculating rental costs and applying discounts is sound. The decision to approve this pull request is made to help you progress in your learning journey. Please review the comments and address the issues mentioned to improve your code quality. Keep up the good work, and continue learning from these experiences! 🚀

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

const LONG_LEASE_DISCONT = 50;
const AVERAGE_LEASE = 3;
const AVERAGE_LEASE_DISCONT = 20;
const PRICCE_FOR_DAY = 40;

Choose a reason for hiding this comment

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

There is a typo in the constant name PRICCE_FOR_DAY. It should be PRICE_FOR_DAY to correctly reflect its purpose.

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