Money_Class

    1| /*
    2| NTC Java Programming 152-116
    3| Instructor: John Heckendorf
    4| Student: Jan Young & Keith Gallistel
    5| Lab ID: & 46314
    6| Project:pepsi.java
    7| */
    8| 
    9| public class Money_Class
  10| {
  11|     final static long serialVersionUID = 5;
  12| 
  13|     private double dCurrent_Transaction = 0;
  14|     private double dBank = 50;
  15| 
  16|     //Instantiated Class
  17|     public Money_Class
  18|     {
  19| 
  20|     }
  21| 
  22|     //Get money in bank
  23|     public double Get_Bank()
  24|     {
  25|         double dB = 0;
  26| 
  27|         dB = dBank;
  28| 
  29|         return dB;
  30|     }
  31| 
  32|     //Get amount of current money customer set
  33|     public double Get_Current()
  34|     {
  35|         double dCurrent = 0;
  36| 
  37|         dCurrent = dCurrent_Transaction;
  38| 
  39|         return dCurrent;
  40|     }
  41| 
  42|     //Accumulate the new current amount with old current amount
  43|     public void Accumulate_Current(double dAmount)
  44|     {
  45|         dCurrent_Transaction += dAmount;
  46|     }
  47| 
  48|     //Set current to zero
  49|     public void Reset_Current()
  50|     {
  51|         dCurrent_Transaction = 0;
  52|     }
  53| 
  54|     //Add current to bank
  55|     public void Register_Sale(double dSale)
  56|     {
  57|         dBank += dSale;
  58| 
  59|     }
  60| 
  61| }