hello im new to java please help me with my assignment!
: i need to do a program like this:
Automatic Teller Machine
[B] Balance
[D] Deposit
[W] Withdrawal
[Q] Quit
select you OPtions:
-------------------------------
once i have chosen an option then i should proceed here
if i choose b:
YOur Balance is ________
if i chose D:
Enter you deposit amount:
___________
if i choose W:
Enter the Withdrawal amount:
________________
(if balance is >= withdrwal display transaction, if balance is < withdrawal display "insufficient Amount"
every after each of the choices a window like this should come out:
Would you Like to generate bank slip?
YES NO
if yes:
for balance:
BALANCE INQUIRY
AMOUNT BALANCE:
____________
Printing bank slip....
for deposit:
DEPOSIT AMOUNT:_____
printing book slip:
for withdrawal:
your withdrwal amount:
______________
=====
if no:
it will return to:
Would you like another transaction?
thats the problem. I dont know how to start this program because i am a beginner, and aside from that i am really eager to learn java please help me with the codes and please explain to me how it works. i only need to use if else statements and do while beacause it is the lesson we are in to, please help m,e
Re: hello im new to java please help me with my assignment!
What have you tried so far? According to what you posted, no effort has been put into the work. This is not a place to get others to do your homework or spoon-feed. Check out the tutorials on conditional statement and then try again. If you get an error, post here and we might help you.
Re: hello im new to java please help me with my assignment!
here is what i did :
public static void main(String[] args) {
int balance= 0;
int deposit = 0;
String a =(JOptionPane.showInputDialog(null, "Automatic Teller Machine\n [B] Balance Inquiry\n [D]Deposit\n [W] Withdrawal\n [Q] Quit\n Select you Options: ","Automatic Teller Machine",JOptionPane.PLAIN_MESSAGE));
String B= "";
if (a == B)//checking for input 1
{
JOptionPane.showMessageDialog(null, "Your Balance is: ");
}
}
}
(im sorry if u think that this contains othing, ive been erasing then typing again im really sorry im a beginner)
Re: hello im new to java please help me with my assignment!
One problem you might have is using == for comparing the contents of two Strings.
You should use the equals() method for that.
Re: hello im new to java please help me with my assignment!
To make it easier for potential helpers, enclose your code with [highlight = java] Your Code Here [/java]. Doing so will highlight your code and make it easier to read.
Re: hello im new to java please help me with my assignment!
According to my information you should try to make use of switch block for this program. and that will be better to make these conditional based prog..