class Vehicle(object):
def __init__(self, make, model):
self.__make = make
self.__model = model
self.__year = 2000
@property
def make(self):
return self.__make
@make.setter
def make(self,value):
self.__make = value
@property
def model(self):
return self.__model
@model.setter
def model(self,value):
self.__model = value
@property
def year(self):
return self.__year
@year.setter
def year(self,value):
if value >= 2000 and
value <=2018:
self.__year = value
v1 = Vehicle("Dodge", "Ram")
v2 = Vehicle("Honda", "Odyssey")
print "v1={} {}".format(v1.make, v1.model)
print "v2={0} {1}".format(v2.make, v2.model)
print
v1.year = 2016
v2.year = 2016
print "v1={} {} {}".format(v1.year, v1.make, v1.model)
print "v2={} {} {}".format(v2.year, v2.make, v2.model)
print
v1.year = 1999
v2.model = "Civic"
v2.year = 2007
print "v1={} {} {}".format(v1.year, v1.make, v1.model)
print "v2={} {} {}".format(v2.year, v2.make, v2.model)
print
it needs to match the sample and the code given can't be modify or removed and...
Each question needs a screenshot of the result and the code. insert appropriate amount of comments in the code. Exercise-1: Plant class. Define a class Plant that satisfies the spec below. Hints A. For this problem, provide an implementation for the Plant spec below, and test it using the example calls provided B. Although the constructor is described in the spec (and called) using the name Plant), the internal name for a class's constructor is_init__(). (There are two underscores before...
We are to make a program about a car dealership using arrays. I got the code to display all cars in a list, so I'm good with that. What I'm stuck at is how to make it so when a user inputs s for search, it allows them to search the vehicle. Here is what I have so far public class Car { String color; String model; String year; String company; String plate; ...
HELLO, PLEASE TAKE TIME TO ANSWER THIS QUESTION. PLESE ENSURE ITS CORRECT AND SHOW THAT THE PROGRAM RUNS. Task 1: Enforcing const-ness throughout Your first job will be to go through all of the code and decide which functions should be declared const. You should find several places throughout the program where this makes sense. We will also make the id data member in the Customer class const , as once a customer has been created their ID will never...