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

car #1628

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

car #1628

wants to merge 2 commits into from

Conversation

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


Thank you for your hard work on this project! 😊 While your implementation of the Car and CarWashStation classes is mostly correct, there are a few critical issues that need to be addressed to meet the core requirements of the task:

  1. Missing Method: The CarWashStation class is missing the wash_single_car method. This method is essential as it should wash a single car by setting its clean_mark to the wash station's clean_power if the wash_station.clean_power is greater than car.clean_mark. Please add this method to fulfill the task requirements.

  2. serve_cars Method: Ensure that the serve_cars method utilizes the calculate_washing_price method to determine the washing price for each car. This will help maintain consistency and promote code reuse.

  3. rate_service Method: Make sure that the rate_service method checks if the num parameter is within a valid range (e.g., 1 to 5) before updating the average rating. This will prevent invalid ratings from affecting the average.

Once these issues are addressed, your code will be much stronger and aligned with the task requirements. Keep up the great work, and I'm confident you'll nail it! 🚀

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

app/main.py Outdated
Comment on lines 19 to 20
if car.clean_mark < self.clean_power:
income += car.comfort_class * (self.clean_power - car.clean_mark) * self.average_rating / self.distance_from_city_center

Choose a reason for hiding this comment

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

In the serve_cars method, you should use the calculate_washing_price method to determine the washing price for each car instead of recalculating it manually. This will ensure consistency and reuse of code.

app/main.py Outdated
return 0

def rate_service(self, num: int):
self.average_rating = round(((self.count_of_ratings * self.average_rating + num) / (self.count_of_ratings + 1)), 1)

Choose a reason for hiding this comment

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

In the rate_service method, ensure that the num parameter is within the valid range (e.g., 1 to 5) before updating the average rating. This will prevent invalid ratings from affecting the average.

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 Car and CarWashStation classes! Your code meets the task requirements and constraints as specified. Here are some highlights and feedback:

  • Car Class: You've correctly implemented the Car class with the necessary attributes: comfort_class, clean_mark, and brand.

  • CarWashStation Class: The CarWashStation class is well-implemented with the required attributes: distance_from_city_center, clean_power, average_rating, and count_of_ratings.

  • serve_cars Method: This method effectively washes cars with a clean_mark less than clean_power and calculates the income using the calculate_washing_price method.

  • calculate_washing_price Method: The washing price is calculated accurately using the car's comfort class, the difference between the wash station's clean power and the car's clean mark, the station's average rating, and the distance from the city center.

  • wash_single_car Method: You've correctly updated the car's clean_mark to the wash station's clean_power when necessary.

  • rate_service Method: This method updates the average rating and count of ratings correctly, ensuring the num parameter is within a valid range (1 to 5).

Your code aligns well with the task requirements, and no further changes are necessary. However, always strive to review and refine your code. If there are any issues, make sure to address them in future projects to enhance your coding skills. Keep up the great work and continue learning from each experience! 🚀

✨ 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