186 Picking Three or More Choices with the IF-THEN-ELSEIF Statement Checking a condition for each set of commands The IF-THEN-ELSEIF statement only runs a command (or block of commands) if some condition is True, as shown in Figure 4-3. Command True Comparison operation False Command True Comparison operation False Figure 4-3: An IF-THEN- ELSEIF statement offers two different sets of commands to follow. Command Command If every conditional expression is False, the IF-THEN-ELSE statement doesn’t run any commands. Only if one of its conditional expressions is True does the IF-THEN-ELSE statement run exactly one set of commands, such as IF (Salary > 100000) THEN TaxRate = 0.45 ELSEIF (Salary > 50000) THEN TaxRate = 0.30 END IF In this example, the computer has three possible choices: ✦ If Salary > 100000, set TaxRate = 0.45. ✦ If Salary > 50000 (but less than 100000), set TaxRate = 0.30. ✦ If Salary
Picking Three or More Choices with the IF-THEN-ELSEIF Statement 187 The first choice checks if the value of the Salary variable is greater than 100000, such as 250000. If so, it tells the computer to set the TaxRate variable to 0.45 and immediately exit out of the entire IF-THEN-ELSEIF statement. The second choice only checks if the value of the Salary variable is greater than 50000. What happens if the Salary value is 150000? In that case, the first choice runs (Salary > 100000), so this second choice would’ve never been checked at all. So although the second choice might seem to run if the Salary variable is greater than 50000, it really won’t run unless Salary > 50000 and the first choice did not run, which means that the Salary variable must be less than or equal to 100000. If the value of the Salary variable is equal or less than 50000, the third choice isn’t to run any additional commands at all. Unlike the IF-THEN- ELSE statement, which always runs at least one set of commands, it’s possible for an IF-THEN-ELSEIF statement to run zero commands. Offering three or more choices The advantage of the IF-THEN-ELSEIF statement is that you can check for multiple conditions and give the computer three or more possible commands (or block of commands) to follow. Book II Chapter 4 Making Decisions by Branching To give the computer additional choices, you can just keep tacking on additional ELSEIF statements, such as IF (True or False) THEN Command ELSEIF (True or False) THEN Command ELSEIF (True or False) THEN Command END IF This example now gives the computer three possible sets of commands to follow. If none of these conditions is True, the IF-THEN-ELSEIF statement may do nothing. To keep checking for additional conditions, you have to add additional ELSEIF statements, such as IF (True or False) THEN Command ELSEIF (True or False) THEN Command ELSEIF (True or False) THEN Command
Agreed in 2016, the motive of the General Data Protection Regulation (GDPR) is to better protect the personal data of European Union “data subjects” – EU citizens and other nationals physically present in the EU at the time data are collected. Visit: https://www.hipaajournal.com/gdpr-training/
The Health Insurance Portability and Accountability Act (HIPAA) was created primarily to modernize the flow of healthcare information, stipulate how Personally Identifiable Information maintained by the healthcare and healthcare insurance industries should be protected from fraud and theft, and address limitations on healthcare insurance coverage – such as portability and the coverage of individuals with pre-existing conditions.