Copy and paste the following definition of the class Car in the submission box and then add a method called brake which decreases the speed by 5. class Car: def __init__(self,year,make): self.year =...


Copy and paste the following definition of theclass Car in the submission box and then add a method calledbrake which decreases the speed by 5.



class Car:


    def __init__(self,year,make):
        self.year = year
        self.make = make
        self.speed = 20


    def getSpeed(self):
        return self.speed


    def accelerate(self):
        self.speed += 5



this is for python.



Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here