
Understand Conditional Statements in Programming
Learn how to decipher conditional statements in programming such as IF statements, embedded IF statements, and decision-making based on conditions. Explore examples like determining if a person is old, calculating salary increases based on years of experience, and more.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
IF Statement Pattern STATE DECISION VALUE IF TRUE YES NO VALUE IF FALSE
Decipher IF Statements If Age is less than 50, enter "NOT OLD", otherwise enter "OLD." YES AGE<50 NOT OLD; NO IF(AGE<50, "NOT OLD", "OLD") OLD
Decipher Embedded IF If AGE is less than 50 and LEN EMP is greater than 10, "Class Z", and IF AGE is not less than 50 or LEN EMP is not greater than 10 "Class X" YES YES LEN EMP >10 AGE<50 Class Z NO NO Class X Class X IF(AGE<50, IF (LEN EMP>10, "Class Z","Class X"), "Class X") IF(AND(AGE<50,LEN EMP>10),"Class Z", "Class X")
Decipher IF Statements If No Years <5, zero increase otherwise increase is $5000. YES No Years < 5 "", NO IIF(No Years < 5, 0, 5000) 5000
Decipher Embedded IF If No Years <5, zero, otherwise if No Years is 5 or greater but less than 10, increase is $5000, and if No Years is 10 or greater, increase is $8000. YES No Years <5 "" NO YES No Years <10 5000 NO 8000 IIF (No Years < 5, 0, IIF (No Years < 10, 5000, 8000))