P.S. I attached a photo of what the applet window looks like for better understanding.
Thank you in advance!
Paul Clapham wrote:I don't see any examples of incorrect data, versus the correct data which you expected. It was also difficult for me to associate the variables in your code with the data in your screenshot. For example there's a variable named "quantity" but I didn't see anything in the screenshot which I could construe as a quantity. So I just scanned the code looking for unusual things. For example, line 143 is an if-condition which can only be true when quantity=1000, and when quantity is greater than 1000 then discountedPrice is zero, which I don't think is what you wanted.
Paul, sorry I should have explained better. I am outputting the costs of fixed quantities by 100s up to 1000. Since I am only going up to 1000, quantities greater than 1000 won't be used. I am using variable quantity in calcWithoutShippingButtonActionPerformed and calcWithShippingButtonActionPerformed. I have a loop that will add 100 to the quantity and return the cost until the quantity reaches 1000.
And you still haven't provided any examples of what you see versus what you expect to see.
However if you want the lines with quantity 100, 200, 300, and so on to have different costs, you ought to do the cost calculation for each of those lines.