QUESTION
Write a class named Car that stores a model, year, and mileage for a vehicle.
Write setter and getter methods for all the instance variables. The instance
variables must be private. Each setter must return True if a value is stored in the
object, otherwise return False. The valid range for years will be 1900 to 2019.
The valid range for mileage is 0 to 1,000,000. There is no error checking for the
model at this time, so automatically return True from this method.
Write a constructor that requires the user to provide the model, year, and mileage
of a car, and in that order.
The setter methods will store a value in the instance variables, if the value needs
the criteria specified earlier. Each setter will return a Boolean value, again as
specified earlier. The setter names must be:
setModel (model)
setYear (year)
setMileage (mileage)
The getter methods return the associated instance variable. The getter names
must be:
getModel()
getYear()
getMileage()
Write the following methods:
equals (Car) – returns True if every item is the same in both objects,
otherwise returns False. You can also write this method such that
the == operator can be used between two Car objects.
highMileage() – returns True if the car has 125,000 miles or more,
otherwise returns False.
__str__ – returns a String that contains all of the information stored in
the object, Remember that this function is called when you print the
object from the program using the object.
Also create a separate main program to thoroughly test your Car class.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus hendrerit. Pellentesque aliquet nibh nec urna. In nisi neque, aliquet vel, dapibus id, mattis vel, nisi. Sed pretium, ligula sollicitudin laoreet viverra, tortor libero sodales leo, eget blandit nunc tortor eu nibh. Nullam mollis. Ut justo. Suspendisse potenti.
Sed egestas, ante et vulputate volutpat, eros pede semper est, vitae luctus metus libero eu augue. Morbi purus libero, faucibus adipiscing, commodo quis, gravida id, est. Sed lectus. Praesent elementum hendrerit tortor. Sed semper lorem at felis. Vestibulum volutpat, lacus a ultrices sagittis, mi neque euismod dui, eu pulvinar nunc sapien ornare nisl. Phasellus pede arcu, dapibus eu, fermentum et, dapibus sed, urna.
Morbi interdum mollis sapien. Sed ac risus. Phasellus lacinia, magna a ullamcorper laoreet, lectus arcu pulvinar risus, vitae facilisis libero dolor a purus. Sed vel lacus. Mauris nibh felis, adipiscing varius, adipiscing in, lacinia vel, tellus. Suspendisse ac urna. Etiam pellentesque mauris ut lectus. Nunc tellus ante, mattis eget, gravida vitae, ultricies ac, leo. Integer leo pede, ornare a, lacinia eu, vulputate vel, nisl.
Suspendisse mauris. Fusce accumsan mollis eros. Pellentesque a diam sit amet mi ullamcorper vehicula. Integer adipiscing risus a sem. Nullam quis massa sit amet nibh viverra malesuada. Nunc sem lacus, accumsan quis, faucibus non, congue vel, arcu. Ut scelerisque hendrerit tellus. Integer sagittis. Vivamus a mauris eget arcu gravida tristique. Nunc iaculis mi in ante. Vivamus imperdiet nibh feugiat est.
Ut convallis, sem sit amet interdum consectetuer, odio augue aliquam leo, nec dapibus tortor nibh sed augue. Integer eu magna sit amet metus fermentum posuere. Morbi sit amet nulla sed dolor elementum imperdiet. Quisque fermentum. Cum sociis natoque penatibus et magnis xdis parturient montes, nascetur ridiculus mus. Pellentesque adipiscing eros ut libero. Ut condimentum mi vel tellus. Suspendisse laoreet. Fusce ut est sed dolor gravida convallis. Morbi vitae ante. Vivamus ultrices luctus nunc. Suspendisse et dolor. Etiam dignissim. Proin malesuada adipiscing lacus. Donec metus. Curabitur gravida