(Removing Duplicated Code in Method main) In the AccountTest class of Fig. 2, method mai n contains six statements (lines 13-14, 15-16, 28-29, 30-31, 40-41 and 42-3) that each display an Account object's name and balance. Study these statements and you'll notice that they differ only in the Account object being manipulated—accountl or account2. In this exercise, you'll define a new displayAccount method that contains one copy of that output statement. The method's parameter will be an Account object and the method will output the object's name and balance. You'll then replace the six duplicated statements in main with calls to displ ayAccount, passing as an argument the specific Account object to output.
Modify class AccountTest class of Fig. 2 to declare the following displayAccount method after the closing right brace of main and before the closing right brace of class AccountTest:

Replace the comment in the method's body with a statement that displays accountToDisplay's name and balance.
Recall that main is a static method, so it can be called without first creating an object of the class in which main is declared. We also declared method displayAccount as a static method. When main needs to call another method in the same class without first creating an object of that class, the other method also must be declared static.
Once you've completed di splayAccount's declaration, modify main to replace the statements that display each Account's name and balance with calls to displayAccount—each receiving as its argument the accountl or account2 object, as appropriate. Then, test the updated AccountTest class to ensure that it produces the same output as shown in Fig. 2.
Fig. 1 Inputting and outputting floating-point numbers with Account objects. (Part 1 of 3.)



We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.