 This is the flowchart for a multi-way if-else statement. In this flowchart, depending on the percent of your maximum heart rate, it tells what training zone you're in. Let's try it with 73% of your maximum heart rate. Is 73% less than or equal to 60%? No, it isn't. Is 73% less than or equal to 70%? No, it isn't. Is 73% less than or equal to 80%? Yes, it is, so our training zone is moderate and we've finished. This flowchart translates into this code. Let's trace it through again with a heart rate of 73% of maximum. Since 73 is not less than 60, we follow the else, and 73 is not less than 70, so we follow that else. 73 is less than 80, and we print moderate and don't do the else clause. You may be wondering why we didn't write this code with compound conditions like this. Let's follow through again with 73% of your maximum heart rate. Is 73 less than or equal to 60? No, it isn't. Since it isn't less than or equal to 60, it must be greater than 60. We don't need to ask that question again. We already know the answer. Is 73 less than or equal to 70? No. Since it's not less than or equal to 70, it must be greater than 70, and again, we don't need to test that condition. When if-else sequences are nested, we can avoid testing unnecessary conditions. There's nothing wrong with indenting and putting braces around this chain of if-else statements. But if we had a couple of more heart rate levels, we'd be marching off the right-hand side of the screen. Remember I said this in a preceding video? Braces in all the places? Now it's time to amend that. Braces in almost all the places. When you think about it, the block I've outlined in red can be considered as one statement. I'm going to set aside the rule of always using braces and join the if to the preceding else. The same logic applies here, which lets us simplify to this. And we can continue the process to end up with this. It's far easier to read as all of the conditions line up nicely. When we write an if-else chain this way, it makes it much easier to add more items to the chain. The only time you can use this shortcut is when the if immediately follows the else. Adding these statements between the else and the if forces us to use braces all the way. By the way, what do you think the output will be if you run this program with a 73% heart rate? Most of the time when you have an if-else chain, your conditions will be testing the same variable. But as long as the if immediately follows an else, you can check different variables, as you can see from this sequence that determines the price of a movie ticket based on the customer's age, the day of the week, and the time of day.