!8.8 Class customization "8.10 LAB: Winning team (classes) 8.9 LAB: Car value (classes) Complete the Car class by creating an attribute purchase_price (type int) and the method print_info() that...

1 answer below »
I have 2 labs that need to be done PYTHON and ENTERED in my ZYBOOKS. I do not want them jus filled out and submitted here, they need to be enter in my ZYBOOKS. My username is
[email protected] & my password is Whiskeybear123


!8.8 Class customization "8.10 LAB: Winning team (classes) 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.2201088.qx3zqy7 LAB ACTIVITY 8.9.1: LAB: Car value (classes) 0 / 10 Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the Rrst box, then click Run program and observe the program's output in the second box. Enter program input (optional) If your code requires input values, provide them here. Input (from above)# main.py (Your program) # Output (shown below) Program output displayed here Signature of your work History of your effort will appear here once you begin working on this zyLab. ma...py Load default template... 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()) Develop mode Submit mode Run program What is this? Feedback? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 My library > IT 140: Introduction to Scripting v3 home > 8.9: LAB: Car value (classes)$ % zyBooks catalog & Help/FAQ Jessica Coupar' ( https://learn.zybooks.com/zybook/SNHUIT140v3/chapter/8/section/8 https://learn.zybooks.com/zybook/SNHUIT140v3/chapter/8/section/10 https://learn.zybooks.com/library https://learn.zybooks.com/zybook/SNHUIT140v3 https://learn.zybooks.com/zybook/SNHUIT140v3/chapter/8/section/9 !8.9 LAB: Car value (classes) "8.11 Modules 8.10 LAB: Winning team (classes) Complete the Team class implementation. For the instance method get_win_percentage(), the formula is: team_wins / (team_wins + team_losses) Note: Use )oating-point division. Ex: If the input is: Ravens 13 3 where Ravens is the team's name, 13 is the number of team wins, and 3 is the number of team losses, the output is: Congratulations, Team Ravens has a winning average! If the input is Angels 80 82, the output is: Team Angels has a losing average. 247772.2201088.qx3zqy7 LAB ACTIVITY 8.10.1: LAB: Winning team (classes) 0 / 10 Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the Srst box, then click Run program and observe the program's output in the second box. Enter program input (optional) If your code requires input values, provide them here. Input (from above)# main.py (Your program) # Output (shown below) Program output displayed here Signature of your work History of your effort will appear here once you begin working on this zyLab. ma...py Load default template... class Team: def __init__(self): self.team_name = 'none' self.team_wins = 0 self.team_losses = 0 # TODO: Define get_win_percentage() if __name__ == "__main__": team = Team() team_name = input() team_wins = int(input()) team_losses = int(input()) team.team_name = team_name Develop mode Submit mode Run program What is this? Feedback? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 My library > IT 140: Introduction to Scripting v3 home > 8.10: LAB: Winning team (classes)$ % zyBooks catalog & Help/FAQ Jessica Coupar' ( https://learn.zybooks.com/zybook/SNHUIT140v3/chapter/8/section/9 https://learn.zybooks.com/zybook/SNHUIT140v3/chapter/8/section/11 https://learn.zybooks.com/library https://learn.zybooks.com/zybook/SNHUIT140v3 https://learn.zybooks.com/zybook/SNHUIT140v3/chapter/8/section/10
Answered 1 days AfterOct 21, 2021

Answer To: !8.8 Class customization "8.10 LAB: Winning team (classes) 8.9 LAB: Car value (classes) Complete the...

Aditya answered on Oct 23 2021
133 Votes
Online Submission
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here