I'm a newbie when it comes to JCreator and Programming. So any help would be greatly appreciated.
Thanks!
Simple Atm Program
Started by
macky021
, Nov 22 2011 09:43 AM
3 replies to this topic
#1
Posted 22 November 2011 - 09:43 AM
#2
Posted 22 November 2011 - 12:48 PM
Could you explain what problem you're having?
#3
Posted 23 November 2011 - 12:38 AM
My problem is I dont know how to make one.
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.
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
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
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










