CSC290: RMI/Concurrency Assignment. Consider the following, very ordinary Java class for simple bank account objects: public class bankaccount { private double balance; private String name; // owner of account public bankaccount(double b, String n) { name = n; balance = b; } public void withdraw(double amt) { balance -= amt; } public void deposit(double amt) { balance += amt; } public double inquiry() { return balance; } public String getname() { return name; } } // class bankaccount. Your assignment is to make this class into one for distributed bank account objects. Different client processes will be calling withdraw, deposit and inquiry as remote procedures. Clearly, you'll need some synchronization mechanisms. Two client processes can be trying to withdraw (i.e. change the balance variable) at the same time. This is clearly a critical section. The withdraw and deposit procedures must be synchronized. Furthermore, your remote bank account should behave as follows: 1. If, when running withdraw, you find that you have insufficient funds (amt>balance), you should suspend the transaction until some other process deposits enough money into your account (look at the bounded buffer example and think carefully about how to do this). Write two client processes, one withdraws while the other deposits. Use Thread.sleep and System.out.print to show what's happening clearly. try { Thread.sleep(500); } catch (Exception e) {} suspends a thread for 500 milliseconds (approx), for example. 2. Modify the bankaccount class to accept an "account auditor" process. Intuitively, the account auditor checks the account periodically (say every 3 seconds) to see if the balance falls below $100. If it does, the account auditor should charge the account a penalty fee of $5 (ouch!) and block withdraw transactions until the balance is above $100 again. It is possible for the auditor to charge an account successive penalties if its balance stays below $100 everytime the auditor checks the account. To do this, add the following to the bankaccount class: public (synchronized?) void acceptaudit() { ... } You should probably also add a boolean variable to indicate if withdraws should be blocked. (you'll have to play around with it to get it to work). Write an auditor process to demonstrate the program. Using Thread.sleep and tweak it to produce a nice simulation.