Please Help
Understand the code in the user package.
13.1. Extract a method. Add a printInfo() method that displays the first and last name
on the console, formatted as follows
First name: Jason
Last name: Slater
Replace the duplicate code in printUsers() with a method call.13.2. Inline a method. Get rid of the ageLessThan16() method.
13.3. Move a method. Move the printInfo() and printAdditionalInfo() methods to the User class.
13.4.Split a variable. The age variable in the calculateAverageAge() method
is used for different intermediate values. Rewrite the method so that it doesn't use this variable.
13.5. Eliminate assignments to arguments. Rewrite the calculateRate() method so that it does not
try to change the method arguments, but instead simply returns a calculated value.
Requirements:
- You need to create a printInfo() method in the User class. It should display the first and last name in the same way that this is done in the printUsers() method in the UserHelper class.
- In the UserHelper class's printUsers() method, you need to replace the duplicate code with calls to the printInfo() method.
- You need to get rid of the UserHelper class's ageLessThan16() method.
- You need to move the printAdditionalInfo() method to the User class. Note that the printAdditionalInfo() method should no longer have a User parameter.
- You need to rewrite the UserHelper class's calculateAverageAge() method so that it does not use the age variable. Remove the age variable.
- Rewrite the UserHelper class's calculateRate() method so that it does not change the method arguments, but instead simply returns a calculated value (the method must return an int).
package com.codegym.task.task29.task2909.user;
public class Job {
private String boss;
public String getBoss() {
return boss;
}
public void setBoss(String boss) {
this.boss = boss;
}
}