Question: Please answer the question. In this assignment, you will have 2 tasks. Task 1: Implement the classes according to the UML diagram given below. greater



Please answer the question.
In this assignment, you will have 2 tasks. Task 1: Implement the classes according to the UML diagram given below. greater than method takes a Greater Than type object and compares itself with that object using its related field. Person class uses it's "id" for greater Than" comparison, Employee class uses it's "salary" for "greater Than" comparison. Write your main class that reads some input from user. 1. First read a string from user 2. Then: If the string is "person", read one integer and one string from user and create a Person object with the given integer as id and string as name. If the string is "employee", read two more integers and one string from user and create an Employee object with these integers where first integer is id, second integer is salary, first string is name. 3. Do the 2nd step once more to create another object. 4. Compare the two objects using greater Than method (e.g. obj.greaterThan(obj2)) and print the result. Please analyse the sample inputs and outputs. Person + id : int greaterThan + greaterThan(greaterThan obj): boolean + Person(id:int, name:string) Employee + salary: int + Employee(id:int, salary: int, name: String) : Sample inputs and outputs person 1 John person 2 Ahmet false employee 10 1000 John employee 20 500 Ahmet true employee 10 20 Ahmet employee 20 100 John false You should submit 4 files for this task: greaterThan.java, Person.java, Employee.java, and Main.java. Task 2: In this task you will use the Person and Employee classes you have written in the previous task. Create a Greater Than type array with 5 size. Then read inputs from user and create 5 objects (Person or Employee) as you did in the first task and put them into the array. In your main method, use Bubble Sort algorithm defined below to sort the 5 objects using their greaterThan methods. Print the sorted objects. If the objects are Person, print their ids. If the objects are Employee print their salaries. You can see the sample inputs and outputs. Note that Person objects will be sorted by their id's whereas Employee objects will be sorted by their salary (why?). Please first analyse the Bubble Sort algorithm and try to understand how it works. Sample inputs and outputs person 58 John person 20 Ahmet person 11 Ali person 33 Paul person 47 Rodriguez 11 20 33 47 58 employee 1 1000 John employee 2 500 Ahmet employee 3 750 Ali employee 4 100 Paul employee 5 900 Rodriguez 100 500 750 900 1000 You should submit 4 files for this task: Less Thanjava, Person.java, Employee.java, and Main.java. Bubble Sort Bubble Sort is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order. Here is an example how to sort integers with Bubble Sort 14 33 27 35 10 Initially let we have 5 size integer array to sort from lowest to highest 14 10 First we compare first two items, they are in order (1st item is less than 2nd). So nothing to do. 14 33 27 35 1 33 27 27 33 35 10 35 10 Next we compare 2 and 3 items. They are not in order, so swap them. 14 We have this situation after swap. 14 27 33 35 10 Next 3rd and 4th items are in order. So no swap. 14 27 33 35 10 4th and 5th items are not in order, so swap them. 14 27 33 10 35 We finished one pass on all items. Now if we repeat the all steps above again and again until no swaps occur, items will be sorted. Please try to visualize why