Question: I don't know what I'm doing wrong here. Need help. 8.9 LAB: Car value (classes) Complete the Car class by creating an attribute purchase_price (type

I don't know what I'm doing wrong here. Need help.

I don't know what I'm doing wrong here. Need help. 8.9 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:

8.9 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: 2011 18000 2018 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. 247772 1680582 LAB ACTIVITY 8.9.1: LAB: Car value (classes) 0 / 10 main.py Load default template... #Defining Car class 2 class Car: 3 def _init_ (self, year, price, value): self . model_year = year self . purchase_price= price 6 self . current_value = value 7 8 def print_info(self) : 9 print("Car's information:") 10 print(" Model year:", self.model_year) 11 print(" Purchase price:", self. purchase_price) 12 print(" Current value: ", self. current_value) 13 14 _name_ == "_main_": 15 year = int(input( )) 16 price = int(input()) 17 value = int(input()) 18 mycar = Car(year, price, value) 19 mycar . print_info()16 price = int(input() ) value = int(input()) 18 mycar = Car(year, price, value) 19 mycar . print_info() Develop mode Submit mode When done developing your program, press the Submit for grading button below. This will submit your program for auto-grading. Submit for grading Signature of your work What is this? 2/21. . U- W-- R-10-10---10--10-10---10--10---10 ..2/25 Latest submission - 11:39 AM on 02/25/21 Total score: 0 / 10 Only show failing tests Download this submission 1: Compare output 0/2 Output differs. See highlights below. 2011 Input 18000 2018 Car's information: Model year: 2011 Your output Purchase price: 18000 Current value : 2018 Car's information: Model year: 2011 Expected output Purchase price: 18000 Current value : 5770 2: Compare output 0/22: Compare output 0 / 2 Output differs. See highlights below. 1995 Input 32000 2020 Car's information: Your output Model year: 1995 Purchase price: 32000 Current value: 2020 Car's information: Expected output Model year: 1995 Purchase price: 32000 Current value: 550 3: Unit test ~ 0/ 4 Tests setting and getting purchase_price Traceback (most recent call last) : TypeError: _init_() missing 3 required positional arguments: 'year', 'price', and 'valu 4: Unit test ~ 0/ 2 Tests Car.print_info() exists Traceback (most recent call last) : TypeError: _init_() missing 3 required positional arguments: 'year', 'price', and 'valu Screenshot saved The screenshot was added to your OneDrive. OneDrive 5 previous submissions

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!