Assignment: Construct a Python program that meets the requirements outlined below.
- Construct an automobile class that will be used by a dealership as a vehicle inventory program. The following attributes should be present in your automobile class:
- private string make
- private string model
- private string color
- private int year
- private int mileage
Your program should have appropriate methods such as:
- constructor
- add a new vehicle
- remove a vehicle
- update vehicle attributes
At the end of your program, it should allow the user to output all vehicle inventory to a text file.
***Below is the code, but it keeps giving me errors and I am not sure how to output to a text file. Please help
class Automobile:
def __init__(self, make, model, color, year, mileage):
self._make = make
self._model = model
self._color = color
self._year = year
self._mileage = mileage
def getMake(self):
return self._make
def getModel(self):
return self._model
def getColor(self):
return self._color
def getYear(self):
return self._year
def getMileage(self):
return self._mileage
def setMake(self, m):
self._make = m
def setModel(self, m):
self._model = m
def setColor(self, m):
self._color = m
def setYear(self, m):
self._year = m
def setMileage(self, m):
self._mileage = m