mmayoub

bank, Accountable interface

Aug 10th, 2017
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.63 KB | None | 0 0
  1. /*
  2.  * Accountable Interface
  3.  * That is the customer requirements from us
  4.  * Do not change it without customer confirmation
  5.  */
  6. package BankInterfaces;
  7.  
  8. import BankExceptions.BankNoCreditException;
  9. import BankPkg.AccountType;
  10.  
  11. public interface Accountable {
  12.     /*
  13.      * return the total number of accounts in the bank
  14.      */
  15.     int getTotalAccount();
  16.  
  17.     /*
  18.      * return the number of accounts from a given type: regular, teenage,
  19.      * business,student as defined in AccountType.java
  20.      */
  21.     int getTotalAccountByType(AccountType type);
  22.  
  23.     /* *********************************************
  24.      * select an account to run the coming methods *
  25.      * *********************************************
  26.      */
  27.  
  28.     /*
  29.      * get the balance of selected bank account
  30.      */
  31.     double getBalance();
  32.  
  33.     /*
  34.      * take money out of selected bank account return true if there is enough
  35.      * funds, false otherwise
  36.      */
  37.     boolean withDraw(double amount) throws BankNoCreditException;
  38.  
  39.     /*
  40.      * put an amount of money in selected account
  41.      */
  42.     void deposit(double amount);
  43.  
  44.     /*
  45.      * set fee for selected bank account
  46.      */
  47.     boolean setAccountFee(double fee); // personal fee, or -1 for default fee
  48.  
  49.     /*
  50.      * get fee for selected bank account
  51.      */
  52.     double getAccountFee();
  53.  
  54.     /*
  55.      * set credit for selected bank account
  56.      */
  57.     public boolean setAccountCredit(int customCredit);
  58.  
  59.     /*
  60.      * set credit to default for selected bank account
  61.      */
  62.     public boolean setAccountCredit();
  63.  
  64.     /*
  65.      * get the account number for the selected account
  66.      */
  67.     int getAccountNumber(); // regular start with 1, teenage start with 2,
  68.                             // business start with 3, student start with 4
  69.  
  70. }
Add Comment
Please, Sign In to add comment