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

done #687

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

done #687

wants to merge 7 commits into from

Conversation

Leo9siy
Copy link

@Leo9siy Leo9siy commented Jan 25, 2025

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! 😊 Your code is well-structured and meets most of the task requirements. However, there's a critical syntax error in the Car class's get_way_value method due to a misplaced division operator. This needs to be corrected for the code to function properly. Once this is fixed, your solution will be ready to go! Keep up the great work, and don't hesitate to reach out if you need any help. 🚀

✨ 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/car.py Outdated
self.fuel_consumption = fuel_consumption

def get_way_value(self, location_from: list, location_to: list) -> float:
way = ((location_to[0] - location_from[0]) ** 2 /

Choose a reason for hiding this comment

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

There is a syntax error here due to the misplaced division operator at the end of this line. It should be moved to the beginning of the next line to correctly calculate the distance.

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 your progress so far! 🎉 Your implementation is mostly correct, but there are a few critical issues that need attention:

  1. Syntax Error in get_way_value Method: There's a syntax error due to an extra + sign in the Car class's get_way_value method. Ensure the line reads:

    way = ((location_to[0] - location_from[0]) ** 2 +
           (location_to[1] - location_from[1]) ** 2) ** 0.5

    This correction is crucial for the code to function properly.

  2. Missing config.json File: The config.json file is referenced but not provided. This file is essential for the application to run correctly, so please ensure it's included.

  3. Code Style and Cleanliness: Maintain consistent code style by using uniform quotes and removing unnecessary comments or print statements before finalizing your code.

Despite these issues, I'm approving your pull request to help you move forward with your learning. Please address these points to improve your code and avoid similar problems in the future. Keep up the good work and continue learning from your experiences! 🚀

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

Comment on lines +7 to +8
way = ((location_to[0] - location_from[0]) ** 2 +
+ (location_to[1] - location_from[1]) ** 2) ** 0.5

Choose a reason for hiding this comment

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

There's a misplaced division operator at the beginning of line 8. The + operator should not be at the end of line 7. Instead, it should be at the beginning of line 8 to correctly sum the two squared differences. This will fix the syntax error in the get_way_value method.



def shop_trip() -> None:
with (open("app/config.json", "r") as config):

Choose a reason for hiding this comment

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

Ensure that the path to the JSON file is correct. According to the checklist, you should write the correct path to the JSON file .

Comment on lines +32 to +34
cost = shop.get_price_of_products(
customer.product_cart) + customer.car.get_way_cost(
fuel_price, shop.location, customer.location) * 2

Choose a reason for hiding this comment

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

Verify that the get_price_of_products method in the Shop class is correctly calculating the total cost of products. This method should sum the cost of each product multiplied by its quantity.

print(f"{customer.name} rides to {shop_to.name}")
customer.location = shop.location

shop_to.bought(customer.name, customer.product_cart)

Choose a reason for hiding this comment

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

Ensure that the bought method in the Shop class is functioning as expected, printing the purchase receipt with the current time and the total cost of the products.

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