Question: Create a Java Class named Automobile. This class should contain private member variables for the description, odometer, current speed, current gear, and public methods to

 Create a Java Class named Automobile. This class should contain private

Create a Java Class named Automobile. This class should contain private member variables for the description, odometer, current speed, current gear, and public methods to access and change the values of these variables. The class should also contain a method called display, this method should print the status of the car. The driver (main method) for this class should create at least 2 automobile objects, populate their data members and then call the display method for each car Class Automobile -description:String -odometer: int -speed: int -gear: char +setDescription(String) +getDescription(): String tsetOdometer(int) +getOdometer(): int +setSpeed(int) +getSpeed(): int +setGear(char) +getGear(): char +display Example: You have the following cars: Description: Ford GT400 Odometer: 2600 miles Speed: 79mph Gear: 3 Description: Toyota Prius Odometer: 147928 miles Speed: 62mph Gear: D

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!