 Let's talk about using braces in if statements. When you have exactly one statement after an if or else, you can leave out the braces as shown on lines 14 and 15 in this program. If I run this program and say I want 10 items, it charges me $80, I don't get a discount. If I say I want 20 items, which is greater than 15, I get my 10% discount. Now let's modify the program to let the user know that they got that 10% discount. This is the additional line that I've added. When I run the program with 20 items, we get the message and the discount. However, if I run the program with 10 items, I don't get a message, but I still get the discount. Why did this happen? Because line 16, even though visually it's intended as if it were part of the if statement, doesn't belong to the if. Remember, without braces, only one statement belongs to the if. Line 15 belongs to the if. As far as Java is concerned, the total really is intended out here. This is not what we want. Instead, we need both statements to be part of the if. So what we need to do is put braces around them to group them together and also indent them properly. Let's recompile. And this time, when I have 20 items, I get the message and the discount. And if I have 10 items, I don't get a message and I don't get the discount either. Another problem with leaving off braces happens when you have nested if statements with one else. What happens if you order 10 items in this program? 10 is not greater than 20. And the way it's written, your eyes tell you that you'll get a 10% discount because the else is lined up with the first if. Let's see what happens. When we say 10, we get the full price. We don't get the discount. Why did this happen? The rule is that an else is always joined to the nearest if. What we really have is this else and this discount belonging to this if, not the if on line 14. If we add braces to group things together, this is what we're really looking at. And that's why with a quantity of 10, we don't get either a 20 or a 10% discount. The book tells you to be careful when writing if statements and to put braces in where they're needed. I say no. The real solution is to always use braces even when there's only one statement because eventually you're going to want to add some other statement and at that point you'll need to have the braces. You may as well put them in from the beginning. The ambiguous else problem is always solved by indenting properly and using braces everywhere. Why do we have this no braces with one statement rule anyway? Back in the 1980s, when disk sizes were measured in megabytes or even kilobytes for personal computers and CPU speeds were on the microsecond scale, every byte counted and every extra byte or brace that you added slowed down compile speeds and took up more room. In a large program, braces on 500 if statements would add a large burden. Minimizing code size was a worthwhile goal. Now disk space is measured in gigabytes and CPUs run at nanosecond speeds. So saving 100 nanoseconds and 50 bytes at the expense of 10 minutes of your time to debug a program because you forgot braces where you needed them, not even remotely worth it. In summary, when you're writing if-else statements use braces in all the places.