make a java code that do the requirements that described in the attached file. I did the java code that did the described requirements in the question but i want you to enhance the code.