# todo: declare purchase_price attribute

9.11 LAB: Car Value (classes)
Complete the Car class by creating an attribute purchase_price (type int) and the method print_info() that outputs the car’s information.
Ex: If the input is:
where 2011 is the car’s model year, 18000 is the purchase price, and 2018 is the current year, then print_info() outputs:
Car’s information:
Model year: 2011
Purchase price: 18000
Current value: 5770
Note: print_info() should use three spaces for indentation.
class Car:
def __init__(self):
self.model_year = 0
# TODO: Declare purchase_price attribute
self.current_value = 0
def calc_current_value(self, current_year):
depreciation_rate = 0.15
# Car depreciation formula
car_age = current_year – self.model_year
self.current_value = round(self.purchase_price * (1 – depreciation_rate) ** car_age)
# TODO: Define print_info() method to output model_year, purchase_price, and current_value
if __name__ == “__main__”:
year = int(input())
price = int(input())
current_year = int(input())
my_car = Car()
my_car.model_year = year
my_car.purchase_price = price

Calculate your order
Pages (275 words)
Standard price: $0.00
Client Reviews
Our Guarantees
100% Confidentiality
Information about customers is confidential and never disclosed to third parties.
Original Writing
We complete all papers from scratch. You can get a plagiarism report.
Timely Delivery
No missed deadlines – 97% of assignments are completed in time.
Money Back
If you're confident that a writer didn't follow your order details, ask for a refund.

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
Power up Your Academic Success with the
Team of Professionals. We’ve Got Your Back.
Power up Your Study Success with Experts We’ve Got Your Back.