Question: Part A Create an Automobile class for a dealership. Include fields for an ID number ( id ) , make ( make ) , model
Part A
Create an Automobile class for a dealership. Include fields for an ID number id make make model model color color year year and miles per gallon mpg
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 default constructor that accepts no arguments and an overloaded constructor that accepts arguments for each field value and uses the set methods to assign the values.
Part B
Write an application called TestAutomobiles that declares two Automobile objects. Write a function called enterData that prompts the user for the data values for an Automobile object and returns that object. When you test the program, be sure to enter some invalid data to demonstrate that all the methods work correctly.
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
