FP-Assignment-Functions-and-Data

Question 01: Implement a Data Structure for Rational Number and create a method neg to class Rational that is used like this:
x.neg // evaluates to -x

Question 02. Create a method sub to subtract two rational numbers and find an answer x-y-z where x=3/4, y=5/8, z=2/7.

Question 03. Implement a Data Structure for Account and create a method transfer which transfer the money from this account to a given account.

Question 04. A Bank defines as List of Accounts. So implement the following functions:

1 List of Accounts with negative balances

2 Calculate the sum of all account balances

3 Calculate the final balances of all accounts after apply the interest function as fallows:

If balance is positive, deposit interest is .05 and if balance is negative, overdraft interest is .1