Lesson Three: Message Alarm
Your clock now has the ability to keep time. You can compare that time to an alarm variable and, when they match, make something happen.
Topics Covered:
In this lesson, you saw how you can combine code fundamentals for more complicated programs. For example, the alarm must match the time exactly for hour, minute, and AM/PM, so you used the && to combine those checks.
Note that around line 97-119 a large 'if' statement holds other 'if' statements inside it. Those are only checked when the first if (at line 97) is true. You should also pay attention to the way they are indented. In our programs, indentation doesn't affect the computer, but it has a huge impact on how easy it is to understand the code. By indenting the 'if' statements that depend on line 97, you can more quickly see how the code flows. Also note that the closing brace } on line 119 lines up with the word 'if' on 97, where that statement begins.