Jump to content


Simple Atm Program


  • Please log in to reply
3 replies to this topic

#1 macky021

macky021

    Newbie

  • Members
  • Pip
  • 5 posts
  • Gender:Male
  • Location:Philippines

Posted 22 November 2011 - 09:43 AM

I'm a newbie when it comes to JCreator and Programming. So any help would be greatly appreciated.
Thanks!

#2 Kraicheck

Kraicheck

    Advanced Member

  • Members
  • PipPipPip
  • 884 posts
  • Gender:Male
  • Location:Belgium

Posted 22 November 2011 - 12:48 PM

Could you explain what problem you're having?

#3 macky021

macky021

    Newbie

  • Members
  • Pip
  • 5 posts
  • Gender:Male
  • Location:Philippines

Posted 23 November 2011 - 12:38 AM

My problem is I dont know how to make one. :biggrin:

Its actually an assignment in school. Our professor told us to make a simple ATM program that already holds a single account and you can do BALANCE INQ, WITHDRAW CASH, etc., by entering the account number.

I dont know where to start with so I thought of asking for your help.

#4 joankim

joankim

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 19 December 2011 - 09:40 PM

So, if I understand you correctly, your program stores values for one bank account, and will only give this info if the correct account number is entered? In that case, this should be easy. This could be an example of code you can use. It will only work for storing one account tho. Using Scanner class for input, needs to be imported into jcreator to work.

int accountnumber = 555555555;
int balance = 500;
int input = in.nextInt();

if(input == accountnumber){
   System.out.println(balance);
}
else if (input !== accountnumber){
   System.out.print(you entered an incorrect accountnumber);
}


This is as specific I can get since you didnt really give any kind of information for what you wanted