Part 1: Writing a Manufacturer Class

With the project open in the IDE, create a new java class named Manufacturer. Your class should store as fields the name of the manufacturer and the country it’s based in (e.g., Mercedes and Germany). The class should include getters and setter methods for each field of the object and appropriate constructors.

Be sure to also override the toString() method so users can print a string representation of the object. In this case, the string you return should be of the form:

,

(where anything in <..> is replaced by its corresponding field).

For example, if the manufacturer is Mercedes and the country of origin is Germany, then your toString() method should return a string that looks like:

Mercedes, Germany

Part 2: Writing a (Car) Model Class

Next create a class named Model that stores fields (with appropriate access modifiers and data types) for:

the name of the model,
a list of java.time.Year objects in which the model was/is in production,
a list of trims that are available for the model,
whether or not the model is currently in production or not.
Here is an example illustrating basic usage of java's Year class:

Year yr = Year.now(); // retrieve the current (calendar) year
yr = Year.of(1997); // assign the year 1997 to the yr variable
Next, add a constructor to the Model class. The constructor should only have formal parameters for the model's name, whether or not the Model is still in production, and a list of Year objects (denoting the years the car model was in production).

In the body of the constructor, add a defensive check to ensure that the list of years passed in is not empty. Here's how you can throw/raise an exception:

throw new IllegalArgumentException("a car model must have at least one production year");
Next, supply a mutator method, addTrim, that takes a trim as a parameter and adds it to the model's list of available trims (the method should return nothing). Lastly, provide getter methods for each of the fields and override the toString() method such that it produces a string of the form:

, in production = ,

Note: this toString implementation assumes that the production years list provided to the constructor is in order (you may assume this).

Part 3: Writing a VehicleType Class

Next, create another class, VehicleType, that encapsulates information about the Kind of vehicle/car being modeled. The class should store as fields:

the Kind of vehicle it is (restrict this to: Truck, Car, Coupe, Station Wagon, Van).
the number of tires (this should be a valid -- non-negative -- int)
First, since there are only 5 distinct kinds of vehicles we want our application to support, this is good opportunity to experiment with java enums (enumerated types). Create a new enum inside the VehicleType class called "Kind" that contains the following values:

TRUCK, CAR, COUPE, STATION_WAGON, VAN
For more information on enumerated types (including examples), check out the java "trails" info page here:

https://docs.oracle.com/javase/tutorial/java/javaOO/enum.html
Next, provide a constructor for VehicleType that takes parameters for the kind of vehicle it is (use the "Kind" enum you just defined as the datatype for this) and the number of wheels it supports. Inside the constructor, provide a defensive check to ensure the number of wheels given is strictly greater than 2, but less than 6 (if either one of these conditions is false, throw an IllegalArgumentException stating "invalid number of wheels!").

Lastly, provide getters for the fields and override toString() such that the object returns a string of the form:

, wheels:

Part 4: Modeling a Vehicle Class

This last class, Vehicle, will bring together all of the other classes you've defined up to this point. This being said, the class should have fields for:

model (use your model class)
manufacturer (use your manufacturer class)
vehicle type (use your vehicle type class)
odometer mileage
mpg
The constructor should should accept formal parameters corresponding to each of these fields and initialize them. Provide getters for each of the fields, and then override toString() to render Vehicle objects in a sensible way of your choosing (see part 5 for one possible way).

Part 5: Bringing it All Together

Lastly, create another java class, Tester, that contains a main method that creates three vehicle objects:

a F150 Truck from 1975,
a Honda Civic from 1996, and
a BMW M3 coupe from 2003.
Put all the Vehicle objects into an array list and print them out using your overridden toString method.