This time, we've just got one big wrap-up problem
A new car is said to devalue 20% in the first year. Assuming that this trend continues and that mileage divided by 100 is all you subtract from this adjusted price, make a class βcarβ that has at least the attributes year, original price (aka og_price), and mileage. Also, follow these guidelines.
str() on a car, it should return the year, original price, mileage, and adjusted price.<aside>
π‘ If you need help with modeling the equation for the adjusted price, this may help:
self.adjustedprice = self.ogprice * (0.8**(2021-self.year))
self.adjustedprice = round((self.adjustedprice, 2)) - self.mileage/100
</aside>
π» Template code
(Optional) Other Special Methods
<aside> βοΈ Copyright Β© 2021 Code 4 Tomorrow. All rights reserved. The code in this course is licensed under the MIT License.
If you would like to use content from any of our courses, you must obtain our explicit written permission and provide credit. Please contact [email protected] for inquiries.
</aside>