Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: hello im new to java please help me with my assignment!

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    2
    My Mood
    Confused
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 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


  2. #2
    Member
    Join Date
    Dec 2011
    Location
    United States
    Posts
    94
    My Mood
    Amused
    Thanks
    5
    Thanked 8 Times in 8 Posts

    Default 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.

  3. #3
    Junior Member
    Join Date
    Jan 2012
    Posts
    2
    My Mood
    Confused
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 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)

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,166
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: hello im new to java please help me with my assignment!

    if (a == B)
    One problem you might have is using == for comparing the contents of two Strings.
    You should use the equals() method for that.

  5. #5
    Member
    Join Date
    Dec 2011
    Location
    United States
    Posts
    94
    My Mood
    Amused
    Thanks
    5
    Thanked 8 Times in 8 Posts

    Default 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.

  6. #6
    Junior Member
    Join Date
    Jan 2012
    Location
    Mumbai
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 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..

Similar Threads

  1. assignment troubles polymorphism (guide for assignment included)
    By tdawg422 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 8th, 2011, 10:01 AM
  2. Help with a java assignment?
    By rberry719 in forum What's Wrong With My Code?
    Replies: 8
    Last Post: September 30th, 2011, 01:02 PM
  3. [SOLVED] OOP java assignment
    By enkei in forum Object Oriented Programming
    Replies: 1
    Last Post: April 27th, 2011, 11:16 AM
  4. Java Assignment Help
    By welsh_rocker in forum What's Wrong With My Code?
    Replies: 4
    Last Post: January 12th, 2011, 06:02 AM
  5. Replies: 1
    Last Post: February 22nd, 2010, 08:20 AM

Tags for this Thread