**THIS IS AN IN CLASS EXCERCISE AND WILL NOT DIRECTLY AFFECT YOUR GRADE**
* Your solutions will be evaluated by the TAs to judge your knowledge of the material so please write neatly and keep your solution organized.
Problem 1: Add the following to the example Polymorphism. First, analyze and design the representation and relationships of the all the current classes and then add classes Cylinder, Sphere, and Trapezoid. Then create the java solution for these classes.
Problem 2: Update the class Driver to receive user input for initializing the different geometric objects. Allow the user to select calling method (recall in this implementation method is the method used to process shapes abstractly). When a selected object is passed to method, have method extract the subclass object reference and place it within a variable of the specific subclass type. Use the instanceof keyword.
Problem 3: In our example from lecture, we did not include all of the details for class creation. Specifically we left out some constructor types, accessor methods, and toString methods. Before including any toString methods, call toString upon the GeometricObject received by method. What happens? Now add in toString methods to each class. What happens now when the program executes and calls toString?
Problem 4: Modify your solution to in class exercise 1 problem 3 to include the following. Vehicle will be an abstract class. It will contain the method load. Load will allow the user to load passengers into the car or freight into the truck. How will you implement the load method in each subclass?
Problem 5: Create the classes Light, TrafficLight, and RailroadCrossingLight. Light will be abstract and the superclass of the other two classes. Light will contain the abstract method change. A TrafficLight will change from red to green to yellow to red. A RailroadCrossingLight will change from flashing red to off. Create the class structures surrounding each of these classes, including all appropriate methods, properties, UML representation of the classes, and a class for testing the system.