Please Use Python Problem Specifications Car Class Design Class Named Car Following Fields Q37252154

Please Use Python:

Problem specifications:

Car Class

Design a class named Car that has the following fields:

  • yearModel: The yearModel field is an Integerthat holds the car’s year model.

  • make: The make field references a String thatholds the make of the car.

  • speed: The speed field is an Integer that holdsthe car’s current speed.

In addition, the class should have the following constructor andother methods:

  • Constructor: The constructor should accept thecar’s year model and make as arguments. These values should beassigned to the object’s yearModel and makefields. The constructorshould also assign 0 to the speed field.

  • Accessors: Design appropriate accessor methodsto get the values stored in an object’s yearModel,

    OR
    OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.