
Advanced Programming Techniques: Selection and Boolean Operators
Explore advanced programming techniques such as IF-ELSE, SELECT CASE, Boolean operators, and nested selection. Learn how selection helps in decision-making and changing program flow based on conditions. Enhance your skills in using selection to optimize code efficiency and handle multiple criteria effectively.
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
www.youtube.com/watch?v=TaRuugE1R74 Keywords IF, ELSE IF, ELSE, SELECT CASE, Boolean, Nested Selection, Condition, Criteria, True, False Programming Techniques Selection
Why use selection? Objectives BEGINNER: Understand when to use selection, including nested selection. The use of selection allows a computer to think make decisions. Selection changes the flow of a program, depending on a set of conditions, it is used for validation, calculation and making sense of a user s choices. Apart from efficiency in reducing the number of lines of code we would run, we need programs to make decisions based on a set of criteria or condition. If the condition is true, we run this set of lines of code, if the condition is false we run some other set of lines. ADVANCED: Recognize the two common types of selection: IF-ELSE IF-ELSE and SELECT CASE/SWITCH EXPERT: Be able to use Boolean operators to narrow and/or expand selection.
Selection Pseudocode and flowchart Objectives BEGINNER: Understand when to use selection, including nested selection. ADVANCED: Recognize the two common types of selection: IF-ELSE IF-ELSE and SELECT CASE/SWITCH EXPERT: Be able to use Boolean operators to narrow and/or expand selection.
Tasks 1. Design and code a program that asks user for a word and if this word is over 5 characters long, it outputs the word with the phrase is too long , otherwise outputs the word. Objectives BEGINNER: Understand when to use selection, including nested selection. 2. Design and code a program that will ask a user for their name. If their name is either John , Nora or Ceredig , the program will output You are on a guest list . For all other names, the program will output Please, join the audience in front of the stage . ADVANCED: Recognize the two common types of selection: IF-ELSE IF-ELSE and SELECT CASE/SWITCH 3. Design and code a program that will ask a user for their name. If their name is either John , Nora or Ceredig , the program will output You are on a guest list , if their name is Amir , Costa or Tony the program will output Follow the red door to the backstage area . For all other names, the program will output Please, join the audience in front of the stage . EXPERT: Be able to use Boolean operators to narrow and/or expand selection.
Selection: Boolean Operators Objectives BEGINNER: Understand when to use selection, including nested selection. ADVANCED: Recognize the two common types of selection: IF-ELSE IF-ELSE and SELECT CASE/SWITCH EXPERT: Be able to use Boolean operators to narrow and/or expand selection.
Selection: Multiple Options Objectives BEGINNER: Understand when to use selection, including nested selection. ADVANCED: Recognize the two common types of selection: IF-ELSE IF-ELSE and SELECT CASE/SWITCH EXPERT: Be able to use Boolean operators to narrow and/or expand selection.
Selection: IF vs Select Case Objectives BEGINNER: Understand when to use selection, including nested selection. ADVANCED: Recognize the two common types of selection: IF-ELSE IF-ELSE and SELECT CASE/SWITCH EXPERT: Be able to use Boolean operators to narrow and/or expand selection.
Selection: Select Case and Boolean Operators Objectives BEGINNER: Understand when to use selection, including nested selection. ADVANCED: Recognize the two common types of selection: IF-ELSE IF-ELSE and SELECT CASE/SWITCH EXPERT: Be able to use Boolean operators to narrow and/or expand selection.
Nested Selection Sometimes, we can only evaluate a condition if some pre-condition is met. We would need two selection statements, one inside the other. The outside selection is the pre-condition, while the inside selection is the condition. There is no limit on how many selection statements we can nest. Objectives BEGINNER: Understand when to use selection, including nested selection. ADVANCED: Recognize the two common types of selection: IF-ELSE IF-ELSE and SELECT CASE/SWITCH EXPERT: Be able to use Boolean operators to narrow and/or expand selection.
Nested Selection and Boolean Operators Objectives BEGINNER: Understand when to use selection, including nested selection. ADVANCED: Recognize the two common types of selection: IF-ELSE IF-ELSE and SELECT CASE/SWITCH Develop a solution that: Asks a user for their user name. If this is a valid user name (is present on the list of user names), it will then ask user for the password. If the password matches the real one, it will welcome the user into the system, otherwise, it will provide them with descriptive feedback of what wrong information they supplied. EXPERT: Be able to use Boolean operators to narrow and/or expand selection.