mjain

ATM Machine OOPs Classes

Jul 25th, 2019
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.11 KB | None | 0 0
  1. package atm;
  2.  
  3. import java.util.Date;
  4.  
  5. public class AtmMachine {
  6.  
  7.     public enum BankAccountStatus {
  8.         ACTIVE, BLOCKED, BANNED, COMPROMISED, UNKNOWN, DISABLED, ARCHIVED;
  9.     }
  10.     public enum TransactionStatus {
  11.         SUCCESS, FALIED, PARTIAL, CANCELLED, INTERUPTTED, FULL, UNKNOWN
  12.     }
  13.  
  14.     public enum TransactionType {
  15.         WITHDRAW, BALANCE_CHECK, CASH_DEPOSIT, CHEQUE_DEPOSIT
  16.     }
  17.     public class Address {
  18.         String street, landmark, city, state, pincode, country;
  19.     }
  20.  
  21.     public class Bank {
  22.         String  bankId;
  23.         String  name;
  24.         Address address;
  25.         // Add ATM
  26.     }
  27.  
  28.     public class ATM {
  29.         String           bankId;
  30.         String           atmId;
  31.         Address          address;
  32.         Screen           screes;
  33.         KeyPad           keypad;
  34.         Cashdispancr     cd;
  35.         Printer          p;
  36.         CheckDepositSlot cdp;
  37.         CashDepositSlot  cashdp;
  38.         // Authenticate user
  39.         // makeTransaction(Customer c,TransactionType t);
  40.     }
  41.  
  42.     public class Screen {
  43.         // display
  44.         TransactionType tType;
  45.     }
  46.     public class KeyPad {
  47.         // take input
  48.     }
  49.     public class Cashdispancr {
  50.         // withdraw money
  51.     }
  52.     public class Printer {
  53.         // print Receipt
  54.     }
  55.  
  56.     public abstract class DepositSlot {
  57.         private double totalAmount;
  58.         // public double getTotalAmount();
  59.     }
  60.  
  61.     public class CheckDepositSlot extends DepositSlot {
  62.         // public double getCheckAmount();
  63.     }
  64.  
  65.     public class CashDepositSlot extends DepositSlot {
  66.         // public double receiveDollarBill();
  67.     }
  68.  
  69.     public class Account {
  70.         String            accountNo;
  71.         String            bankID;
  72.         BankAccountStatus status;
  73.         int               avilableBalance;
  74.  
  75.     }
  76.     public class Card {
  77.         String  carNumber;
  78.         Date    expiry;
  79.         String  cardType;
  80.         String  pincode;
  81.         Address billingAddress;
  82.     }
  83.     public class Customer {
  84.         String  name, mobile, email;
  85.         Address address;
  86.         Account account;
  87.         Card    card;
  88.         // changeBillingAddress
  89.         // make transcation(Transaction );
  90.     }
  91.  
  92.     public abstract class Transcation {
  93.         String            transctionId;
  94.         Date              creation;
  95.         TransactionStatus status;
  96.  
  97.     }
  98.     public class WithDraw extends Transcation {
  99.         double withdrawAMount;
  100.     }
  101.     public class BalanceCheck extends Transcation {
  102.         String accountNo;
  103.     }
  104.  
  105.     public abstract class Deposit extends Transcation {
  106.         private double amount;
  107.         // public double getAmount();
  108.     }
  109.  
  110.     public class CheckDeposit extends Deposit {
  111.         private String checkNumber;
  112.         private String bankCode;
  113.  
  114.         // public String getCheckNumber();
  115.     }
  116.  
  117.     public class CashDeposit extends Deposit {
  118.         private double cashDepositLimit;
  119.     }
  120.  
  121.     public class Transfer extends Transcation {
  122.         private int destinationAccountNumber;
  123.         // public int getDestinationAccount();
  124.     }
  125. }
Add Comment
Please, Sign In to add comment