0

Hello Dear!
Hope You All are doing Fine. i have querry. i am trying to make a program of Bank Account Details with classes and OBjects. i have put change name, change typ, dopist, withdraw options. now i want to see teh history. what name it was before the change, and how much amount was deposited and what amount was withdrawn. i am unable to make a logic. can you guys help me out!

This is the output of Program....

         Welcome to XXXX Bank of Hing Hong 

         1. Details of Mr. AGHJ
         2. Details of Mr. TYUII
         3. Details of Mr. QTYUII
         4. Exit

         Enter Your Choice : 

     Welcome Mr. AGHJ In Customer Profile Page

    Account Name : AGHJ      Account Type : Saving

         1 .  Change Account Name
         2 .  Change Account Type 
         3 .  Display Account Number
         4 .  Current Balance
         5 .  WithDraw Amount
         6 .  Deposit Amount
         7 .  Recent History 
         0 .  Back

        Enter Your Choice : 
2
Contributors
1
Reply
6
Views
2 Years
Discussion Span
Last Post by stultuske
1

What you can do to keep a history of the names:
add an instance variable ( a list of names) and each time you call the changeName method, do something like this:

private List<String> previousNames = new ArrayList<String>();
private String name;

// ...

public void changeName(String newName){
  this.previousNames.add(this.name);
  this.name = newName;
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.