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 13 of 13

Thread: HELP ME! How to update quantity (JAVA)

  1. #1
    Junior Member
    Join Date
    Jul 2011
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default HELP ME! How to update quantity (JAVA)

    thanks alot. i have solved it.
    Last edited by kerrina; July 31st, 2011 at 02:47 PM.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: HELP ME! How to update quantity (JAVA)

    why it is that it does not show my update quantity?
    What line in your program is supposed to show that? Did you leave off a println?
    What is the name of the variable that you want to display?

    qty[count-1]=input.nextInt();
    You should test that the value of count is valid. Using its value as an index could case an error.

  3. #3
    Junior Member
    Join Date
    Jul 2011
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: HELP ME! How to update quantity (JAVA)

    thanks alot. i have solved it.
    Last edited by kerrina; July 31st, 2011 at 02:46 PM.

  4. #4
    Junior Member
    Join Date
    Jul 2011
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: HELP ME! How to update quantity (JAVA)

    I can't update my quantity. when i add or subtract, it does not show up.

  5. #5
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: HELP ME! How to update quantity (JAVA)

    Please edit your code and wrap it in code tags to preserve the formatting. See: http://www.javaprogrammingforums.com...do=bbcode#code

    Please post the console from when you execute your program that shows the problem.
    Add comments to it showing where the problem is.
    To copy the contents of the command prompt window:
    Click on Icon in upper left corner
    Select Edit
    Select 'Select All' - The selection will show
    Click in upper left again
    Select Edit and click 'Copy'

    Paste here.

  6. #6
    Junior Member
    Join Date
    Jul 2011
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: HELP ME! How to update quantity (JAVA)

    may i know where to add validation?

  7. #7
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: HELP ME! How to update quantity (JAVA)

    may i know where to add validation?
    Sorry, I have no idea what you are asking?

  8. #8
    Junior Member
    Join Date
    Jul 2011
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: HELP ME! How to update quantity (JAVA)

    ● Validation (and feedback)
    The program should handle ALL invalid entries by the user, e.g. invalid numeric data, adding when the array is full, etc. If user made a mistake in the entry, the program should inform the user via appropriate feedback.

  9. #9
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: HELP ME! How to update quantity (JAVA)

    Is this a new problem?
    Have you solved the quantity update problem?

    If user made a mistake in the entry, the program should inform the user via appropriate feedback.
    That is often done by using an if() statement to test the contents of the data before it is stored into an array to be saved. If the data is bad, a message is output and the input requested again.

  10. #10
    Junior Member
    Join Date
    Jul 2011
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: HELP ME! How to update quantity (JAVA)

    I have not yet solve the problem. trying to solve now.

  11. #11
    Junior Member
    Join Date
    Jul 2011
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: HELP ME! How to update quantity (JAVA)

    Yeah. but, i don't know where to add validation

  12. #12
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: HELP ME! How to update quantity (JAVA)

    Lets work on one problem at a time.
    Where does your program update the quantity? Add a println there to show what its new value is.
    Then add a println to show its value after the call to the method that updated it to see if there was a problem there.

  13. #13
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: HELP ME! How to update quantity (JAVA)

    Please do not delete your original post. This thread has just been rendered useless.
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

Similar Threads

  1. [SOLVED] Update Values Globally
    By techwiz24 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: June 10th, 2011, 06:20 PM
  2. button update when clicked
    By prettynew in forum AWT / Java Swing
    Replies: 4
    Last Post: March 13th, 2011, 04:47 PM
  3. Update table in database
    By CTheSky in forum JDBC & Databases
    Replies: 4
    Last Post: February 24th, 2011, 02:02 AM
  4. Cannot update data in .txt/.csv file
    By Azriq007 in forum JDBC & Databases
    Replies: 2
    Last Post: October 16th, 2010, 09:16 PM