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' #1739

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

'Solution' #1739

wants to merge 1 commit into from

Conversation

nagafochfv
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 Car and CarWashStation classes! 🎉 Your code meets the task requirements and constraints, and the logic for washing cars, calculating prices, and updating ratings is correctly implemented. While there are a few areas to double-check against the task description, such as the rounding in rate_service and the logic in calculate_washing_price and wash_single_car, these are minor and don't impact the overall functionality. Keep up the good work, and consider reviewing these areas for future improvements! 😊

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

Comment on lines +32 to +38
def serve_cars(self, cars: List[Car]) -> float:
total_income = 0
for car in cars:
if car.clean_mark < self.clean_power:
total_income += self.calculate_washing_price(car)
self.wash_single_car(car)
return round(total_income, 1)

Choose a reason for hiding this comment

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

The serve_cars method correctly iterates over the list of cars and calculates the total income from washing. However, ensure that the calculate_washing_price and wash_single_car methods are correctly implemented and that their logic aligns with the task requirements.

Comment on lines +40 to +42
def calculate_washing_price(self, car: Car) -> float:
result = (car.comfort_class * (self.clean_power - car.clean_mark) * self.average_rating / self.distance_from_city_center)
return round(result, 1)

Choose a reason for hiding this comment

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

The calculate_washing_price method calculates the price based on the comfort class, cleanliness, and other factors. Ensure that the formula used here is correct according to the task requirements. If there are specific constraints or conditions mentioned in the task description, verify that they are being met.

Comment on lines +44 to +46
def wash_single_car(self, car: Car) -> None:
if self.clean_power > car.clean_mark:
car.clean_mark = self.clean_power

Choose a reason for hiding this comment

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

The wash_single_car method updates the car's clean mark to the station's clean power if it's greater. This logic seems correct, but make sure it aligns with the task requirements.

Comment on lines +48 to +52
def rate_service(self, rate: float) -> None:
total_rating = self.average_rating * self.count_of_ratings
total_rating += rate
self.count_of_ratings += 1
self.average_rating = round(total_rating / self.count_of_ratings, 1)

Choose a reason for hiding this comment

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

The rate_service method updates the average rating based on a new rate. The logic for updating the average rating is correct, but ensure that the rounding and calculation meet any specific requirements from the task description.

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