The Ti-84 Plus calculator can handle three decision commands (If, If . . . Then . . . End, and If . . . Then . . . Else . . . End). Here is how to use these commands in a program.
The If command
The structure of the If command appears in the first screen. If the condition following the If command is true, the program executes the command following the If statement (Command 1) and then moves on to the next command in the program (Command 2).
If the condition following the If command is false, the program skips the command following the If statement (Command 1) and then moves on to the next command in the program (Command 2).
An example of using the If command appears in the second screen. The program in this screen gives a 10 percent discount on items that cost $50 or more. The input and output commands (Input, Disp) in this program are housed in the Program I/O menu, which is accessed by pressing [PRGM] and the right-arrow key. You can enter the inequality that appears in this screen by pressing [2nd][MATH][4].
The If . . . Then . . . End command
The structure of the If . . . Then . . . End command appears in the first screen. If the condition following the If command is true, the program executes the commands between Then and End (Commands 1) and then moves on to the next command in the program (Command 2).
If the condition following the If command is false, the program skips the commands between Then and End (Commands 1) and then continues on to the next command in the program (Command 2).
An example of using the If . . . Then . . . End command appears in the second screen. The program in this screen gives a 10 percent discount on items that cost $50 or more and then takes off another $10 if the discounted cost is over $100.
The If . . . Then . . . Else . . . End command
The structure of the If . . . Then . . . Else . . . End command appears in the first screen. If the condition following the If command is true, the program executes the commands between Then and Else (Commands 1), skips the commands between Else and End (Commands 2), and then moves on to the next command in the program (Command 3).
If the condition following the If command is false, the program skips the commands between Then and Else (Commands 1), executes the commands between Else and End (Commands 2), and then moves on to the next command in the program (Command 3).
An example of using the If . . . Then . . . Else . . . End command appears in the second screen. The program in this screen divides a number by 2 if it is even, or adds 3 to the number if it isn’t.
So that the program in the second screen fits all on one screen, the colon symbol is used to separate two commands (instead of placing the commands on separate lines.)