Reference no: EM13336777
Creating your base classes
Create a new project in Eclipse called Assignment 1.
Within this project create a package called task02.
1. Authortwo new classes within your newly created package. Choose two related real world objects (similar to the Person and Car objects in the sample code provided) that you are modelling where one object might own or use or provide a service to the other object. e.g. a Person might own a Pet, a library might own a Book, a Person might hire a Video, a Teacher might teach a Student, a Coach might train an Athlete, a Dentist might treat a Patientetc.Due to this relationship, one of your objects will have a reference to the other object (similar to the Person having a Car).
2. Descriptions of each class and Class diagramsmust be entered into your document created in task1. List any assumptions you make. Describe the relationship between the classes.
3. Explain the methods that you have authored - provide a description and type of any parameters and describe the purpose for each method.
4. Give an example of output that would be produced by your method/s.
5. Explain the constructors that you have provided. You must provide at least 2 constructors:
a. A no-parameter constructor which assigns each instance variable a default value. The String variables (e.g. name) should be initialised to "unknown", and object fields initialised to null.
b. A constructor with parameters which assigns values to each instance variable. Note that the values to initialise the fields and objects should be passed in using argumentswhen the constructor is called - the fields should not be instantiated in the constructor.
6. Write get and set methods for your classes for each instance variable.
7. Write a toString method that will return a String containing all the relevant data for each of your objects.
8. Create a new Test02 class. In this class, provide a main method containing code to test both constructors, at least one get and one set method and your toString method.Run your test and make sure your class is behaving correctly.
9. In your documentation, explain how you have tested your code and the results of your testing. Include screen shots demonstrating the output when you tested your code.