removed

The second pen order overwrites the first value of $1.20 in totalPen, so the code at the end is only adding up these values:

2 notebooks = $3.00
2 pens (with the coupon) = 0.50
7 pencils = $1.05
@wpark6765
What you have done is not likely to make you friends -- and I'll explain why.

Here is a public forum. Many people often have the same difficulties when learning programming (beginner, intermediate, expert -- it doesn't matter). When you post on a public forum, you are asking for public help. People with the same kind of problem you are having are going to want to see the answer as well.

People who take the time to answer the question do so because they wish to help as many people as possible. It makes them feel good.

When you delete your question, leaving an unintelligible answer to an unknown question, you have essentially told all the people who took the time to help you that, no, really, their time and effort is not valuable -- you've just thrown it away.

And it appears as selfishness on your part -- whether deserved or not -- because only you are privileged to get an answer.

JSYK, if in the future you get some vitriol for doing the same.
Topic archived. No new replies allowed.