Question 9 (6 points) We have three classes below: Account, AccountList, and AccountsDriver. Your task is to understand these three classes and add some code to the main() method of AccountsDriver, as directed by questions(a) and (b). There are some comments placed in Account and Accounts Driver, which I hope would be helpful. As always, please let me know if something is not clear. The main purpose is to learn, not just to test you -8 21 public class Account [ private double balance: private int account Number: private static int counter = 1; public Account(double balance) { this.balance - balance; this.account Number - countert: 24 27 3 Assume toString() is overridden here to return a proper representation of the Account // object. The code is not shown. || Assume toString() is overridden here to return a proper representation of th Account 3 Il object. The code is not shown. N 6 public class AccountList implements Iterable 1 2. private List accounts = new LinkedList(); public void add(Account account) { accounts.add(account); 11 12 14 15 public Iterator iteratori return accounts.iteratoro): 3 17 18 1 20 21 23 24 Complete the following class, public class Accounts Driver public static void main(String[] args) throws Exception AccountList my Collection = new AccountListo; 26 27 Il code to store a large number of Account objects into myCollection: not shown Part (a) - write code to store all the objects into a disk file named accounts Part (b) - write code to read the disk file accounts: then use the data public static void main(Stringu args) throws Exception { AccountList myCollection = new AccountList(); Il code to store a large number of Account objects into myCollection: not shown 7 Part (a) - write code to store all the objects into a disk file named accounts // Part (b) - write code to read the disk file accounts; then use the data // so read in to display all the accounts. // Remember that toString() is properly overridden in Account a) Write code in the main() method, so all the objects created in the method (see the comments) are written into a file named accounts. Also write any modifications needed for the two classes Account and AccountList. b) Continue writing code ilahe main() method to read the disk file accounts created in Step (); then use the data that is read to display all accounts stored in the disk file. Remember that the Account class has a toString() method for returning the content of an Account object. You will need to use the iterator() method of Accounts. If you don't know how to use an Iterator object, look up, or discuss, or ask me. 27 Question 28 (4 points) Modify the following class, so it uses generics, wherever possible. import java.util.Iterator; import java.util.LinkedList; import java.util.List; public class MyList implements Iterable ( private List myStuff = new LinkedList(); public void add(Object object) [ myStuff.add(account); public Iterator object( [ return myStuff.iterator: Question 9 (6 points) We have three classes below: Account, AccountList, and AccountsDriver. Your task is to understand these three classes and add some code to the main() method of AccountsDriver, as directed by questions(a) and (b). There are some comments placed in Account and Accounts Driver, which I hope would be helpful. As always, please let me know if something is not clear. The main purpose is to learn, not just to test you -8 21 public class Account [ private double balance: private int account Number: private static int counter = 1; public Account(double balance) { this.balance - balance; this.account Number - countert: 24 27 3 Assume toString() is overridden here to return a proper representation of the Account // object. The code is not shown. || Assume toString() is overridden here to return a proper representation of th Account 3 Il object. The code is not shown. N 6 public class AccountList implements Iterable 1 2. private List accounts = new LinkedList(); public void add(Account account) { accounts.add(account); 11 12 14 15 public Iterator iteratori return accounts.iteratoro): 3 17 18 1 20 21 23 24 Complete the following class, public class Accounts Driver public static void main(String[] args) throws Exception AccountList my Collection = new AccountListo; 26 27 Il code to store a large number of Account objects into myCollection: not shown Part (a) - write code to store all the objects into a disk file named accounts Part (b) - write code to read the disk file accounts: then use the data public static void main(Stringu args) throws Exception { AccountList myCollection = new AccountList(); Il code to store a large number of Account objects into myCollection: not shown 7 Part (a) - write code to store all the objects into a disk file named accounts // Part (b) - write code to read the disk file accounts; then use the data // so read in to display all the accounts. // Remember that toString() is properly overridden in Account a) Write code in the main() method, so all the objects created in the method (see the comments) are written into a file named accounts. Also write any modifications needed for the two classes Account and AccountList. b) Continue writing code ilahe main() method to read the disk file accounts created in Step (); then use the data that is read to display all accounts stored in the disk file. Remember that the Account class has a toString() method for returning the content of an Account object. You will need to use the iterator() method of Accounts. If you don't know how to use an Iterator object, look up, or discuss, or ask me. 27 Question 28 (4 points) Modify the following class, so it uses generics, wherever possible. import java.util.Iterator; import java.util.LinkedList; import java.util.List; public class MyList implements Iterable ( private List myStuff = new LinkedList(); public void add(Object object) [ myStuff.add(account); public Iterator object( [ return myStuff.iterator