thanks alot. i have solved it.
Printable View
thanks alot. i have solved it.
What line in your program is supposed to show that? Did you leave off a println?Quote:
why it is that it does not show my update quantity?
What is the name of the variable that you want to display?
You should test that the value of count is valid. Using its value as an index could case an error.Code :qty[count-1]=input.nextInt();
thanks alot. i have solved it.
I can't update my quantity. when i add or subtract, it does not show up.
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.
may i know where to add validation?
Sorry, I have no idea what you are asking?Quote:
may i know where to add validation?
● 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.
Is this a new problem?
Have you solved the quantity update problem?
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.Quote:
If user made a mistake in the entry, the program should inform the user via appropriate feedback.
I have not yet solve the problem. trying to solve now.
Yeah. but, i don't know where to add validation
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.
Please do not delete your original post. This thread has just been rendered useless.