Write a program that, given a string s as input, prints the string obtained by removing all duplicate characters from s (that is, retain only the first occurrence of each character). The characters should appear in the output in the same order as they appear in s.
Note: str.charAt(arg) returns the character present at index arg in the string str.
Sample input 1: eerie, output: eri
Sample input 2: abcd, output: abcd
Write a program that, given a string `s` as input, prints the string obtained by removing all duplicate characters from `s` (that is, retain only the first occurrence of each character). The characters should appear in the output in the same order as they appear in `s`. Note: `str.charAt(arg)` returns the character present at index `arg` in the string `str`. Sample input 1: `eerie`, output: `eri` Sample input 2: `abcd`, output: `abcd` It has been decided to give a promotion to one of the four employees in the Sales department of a company based on the following criteria. An employee with the maximum number of years of experience is considered the ideal candidate for promotion. If two employees have the maximum experience, then the one who has taken the minimum number of days of leave will be considered for promotion. Assume that no two of them have taken the same number of days of leave. Class `Employee` must implement the interface `Comparable`, and should have the following members. - Instance variables: `ID` (employee ID), `experience` (number of years of experience), `nleaves` (number of days of leave taken so far) - Override the method `equals(Object o)` such that it returns `true` if the two employees being compared have the same `ID`; else, return `false`. - Override the method `compareTo` to compare two `Employee` objects, based on `experience` and `nleaves`. Class `Company` has two methods: - The method `main()` accepts the inputs to instantiate four objects of `Employee` type. The input is accepted in the order `ID`, `experience`, and `nleaves`, for each employee. It then invokes the method `displayID(e)`, which returns the ID of the employee who gets the promotion, by using the method `compareTo(Employee e)` inside the class `Employee`. Write a program that, given the x and y coordinates of two points `p1(x1, y1)` and `p2(x2, y2)` on a two-dimensional plane, finds the mid-point `p3(x3, y3)` of the line segment formed by `p1` and `p2` using the formula: `x3 = (x1 + x2) / 2` and `y3 = (y1 + y2) / 2` Class `Point` has the following members. - Instance variables `x` and `y` - A constructor to initialize `x` and `y` - A method `mid(Point p)` to return the mid-point of the line segment joining the current point to `p` - A method that overrides the method `toString()` in the `Object` class to format the output Class `Test` has the main method. - The main method accepts the two input points. The first line of input will be `x1` and `y1` of point `p1(x1, y1)`. The second line of input will be `x2` and `y2` of point `p2(x2, y2)`. It then invokes the method `mid` of one of the objects. Sample input 1: `3 4` and `5 6`, output: `(4,5)` Sample input 2: `-3 4` and `-5 6`, output: `(-4,5)`