Question: Create an Automobile class for a dealership. Include fields for an ID number, make, model, color, year, and miles per gallon. Include get and set
Create an Automobile class for a dealership. Include fields for an ID number, make, model, color, year, and miles per gallon. Include get and set methods for each field. Do not allow the ID to be negative or more than ; if it is set the ID to Do not allow the year to be earlier than or later than ; if it is set the year to Do not allow the miles per gallon to be less than or more than ; if it is set the miles per gallon to Include a constructor that accepts arguments for each field value and uses the set methods to assign the values. Write an application that declares two Automobile objects and prompts the user for values. When you test the program, be sure to enter some invalid data to demonstrate that all the methods work correctly. Save the files as Automobile.java and TestAutomobiles.java.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
