Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2011
    Posts
    50
    Rep Power
    0

    Default basic bank account

    i want write program for add new account, deposit money, withdraw money, transfer between accounts and display interest.

    Java Code:
    	public void createaccount(){
    		
    		Scanner input = new Scanner(System.in);
    		System.out.println("Enter customer name:");
    		name = input.nextLine();
    		
    		System.out.println("enter account id");
    		id = input.nextInt();
    		
    		System.out.println("enter balance money");
    		balance = input.nextFloat();
    
    		System.out.println("enter creation date (dd/mm/yyyy) ");
    		date = input.nextLine();
    	}
    	
    	public void deposit(){
    		
    		Scanner input= new Scanner(System.in);
    		System.out.println("enter deposit money");
    		balance+= input.nextFloat();
    	}
    	
    	public void withdraw(){
    		
    		Scanner input= new Scanner(System.in);
    		System.out.println("enter withdraw money");
    		balance+= input.nextFloat();
    		
    	}
    
    }
    i wrote this code.and think for transfer function(withdraw from one account and deposit to another account). but where do i store more than one account?
    Last edited by captain_turkiye; 10-13-2011 at 03:24 PM.

  2. #2
    doWhile is online now Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    7

    Default Re: basic bank account


  3. #3
    mine0926 is offline Senior Member
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    580
    Rep Power
    5

    Default Re: basic bank account

    You can create transfer or transferFunds method in your Account class which has a parameter of another account number (or Account).
    Java Code:
        public void transerFunds(Account anotherAccount)
        {
            //.... Your code on transfering funds
        }
    Your class also need getXXX and setXXX method so that you can do all the things to have communication betwwen to other class.

    And if you post same topic in other forum, please tell both forum and put link. We do not want to waste our time answering question that
    has been answered in other forum.

    Goodluck!

  4. #4
    Join Date
    Oct 2011
    Posts
    50
    Rep Power
    0

    Default Re: basic bank account

    can any body help me? i want use simple array, not arraylist.

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: basic bank account

    Quote Originally Posted by captain_turkiye View Post
    can any body help me? i want use simple array, not arraylist.
    You have not addressed the cross-post issue yet, and many here will withhold giving answers until this has been clarified. We request that you please show all links of all cross-posts, and in the future show all links without our requesting that you do so.

  6. #6
    Join Date
    Oct 2011
    Posts
    50
    Rep Power
    0

Similar Threads

  1. Adding Interest to a Bank Account
    By petur170 in forum New To Java
    Replies: 20
    Last Post: 05-26-2011, 02:28 AM
  2. Bank Account Project
    By Haal in forum New To Java
    Replies: 0
    Last Post: 03-20-2011, 07:30 PM
  3. how to make to classes in the bank account program
    By buzzing in forum New To Java
    Replies: 3
    Last Post: 11-02-2010, 04:02 AM
  4. java bank account problem
    By awil121 in forum New To Java
    Replies: 1
    Last Post: 10-13-2010, 10:47 PM
  5. Bank Account
    By HPcompaq256 in forum New To Java
    Replies: 11
    Last Post: 02-26-2010, 09:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •