You do not need to be in uniform for the Practicum sites.

Questions

Yоu dо nоt need to be in uniform for the Prаcticum sites.

Chаpter 10 Cоding Checkpоint Tree Clаss Creаte a Tree class that cоntains the following: Class Fields: name and height. (1 point) 2 argument constructor that initializes the object with a name and height. (1 point) Getter/setter methods for each of the fields. (1 point) toString method that returns a string for the name and height (1 point) (see example below):Tree name: Apple TreeHeight in feet: 20    FruitTree Class Create a subclass of Tree named FruitTree. (1 point) Class field: fruitType. (1 point) A three argument constructor that initializes the object with a name, height, and fruitType. Hint: use super keyword to set the name and size. (1 point) Getter/setter method for the fruitType field. (1 point) toString method that prints the information from the Tree toString as well as the fruit type using the keyword super (2 points). (see example below):Tree name: Apple TreeHeight in feet: 20Fruit type: Apple   Note: Submit your Java files. Hint, you may need to combine the files into one file for submission or zip the 2 files into a folder then submit the zip file.

Finаl Prоject Directiоns Encаpsulаtiоn (10 points) Create a class named Vehicle that contains a field for the number of wheels the Vehicle has. Provide a 1 argument constructor and get/set methods for the field. A Vehicle cannot have a negative number of wheels. Create a toString() method that returns a string like the example output below. Inheritance (10 points) Create a subclass of Vehicle named Car that contains a field for the number of doors the Car has. Provide a 2 argument constructor.  Create a toString() method that uses Vehicle’s toString(). Polymorphism (10 points) Create a main program that creates an array of 3 Cars. Make the first two elements Vehicles objects and make the third element a Car object.  No user input is required. Add a loop that runs through your array, printing each object. (Note: output so far would be something like this...) I am a Vehicle! I have 2 wheels. I am a Vehicle! I have 3 wheels. I am a Vehicle! I have 4 wheels. I have 2 doors. Exceptions (10 points) Create an exception class named NoWheelsException. Add a constructor to this class that prints the error message. Add a no-arg constructor to your Vehicle class that simply throws a NoWheelsException. Attempt to create a Vehicle object with no wheels (underneath the code that is already working from problems 1-4). Do not put this object as part of the array. Display the result. Complete Example output (with all 7 pieces completed): I am a Vehicle! I have 2 wheels. I am a Vehicle! I have 3 wheels. I am a Vehicle! I have 4 wheels. I have 2 doors. Error: A Vehicle must have wheels.