Notes

What is Boolean

  • Denotating system of algorithmic notation in computing or electronics
    • Boolean examples are either true or false
      • Example: Sky is blue - True

Relational operators

  • The mathmatical relationship between two variables
  • Determines an output on whether or not the statement is true
  • a=b, a>b, etc.

Logical Operators

  • NOT displays the opposite of whatever the data is
    • usually used for true/false

  • AND is used to evaluate 2 conditoons together to determine of both conditions are met
    • Example: if grade is above 70 and grade is below 100, you passed the quiz.

  • OR, if one of the conditions are met, the function works.

Conditionals

  • Conditionals allow for the expression of algorithms that utilize selection without a programming language.
  • Writing conditional statements is key to computer science.
  • Determine the result of conditional statements

Key Terms

  • Selection is The specific block of code that will execute depending on the algorithm condition returning true or false.
  • Algorithm is “A finite set of instructions that accomplish a specific task.”
  • Conditional Statement / If-Statement is a statement that affects the sequence of control by executing certain statements depending on the value of a boolean.

  • Conditional statements (“if” statements) affect the sequential flow of control by executing different statements based on the value of a Boolean expression. The exam reference sheet provides:

  • In which the code in block of statements is executed if the Boolean expression condition evaluates to true; no action is taken if condition evaluates to false

Nested Conditionals

  • Conditional statments within a conditional statement
    • example: an else if inside of another else-if\
    • Can be used for a varying amount of “else if statements.” The first if statement can represent if two coditions are true. The first else if can represent if only one or the other is true. The last else if represents if neither of the conditions are true.
    • Can have three different conditions

Hacks

Hack 1: Explain and code a scenerio of each logical operator

  • NOT displays the opposite of whatever the data is

  • AND is used to evaluate 2 conditoons together to determine of both conditions are met

  • OR, if one of the conditions are met, the function works.

Hack 2: Define Key Terms (With Examples) and Nice Review Ticket

  • 1pt for defining key terms in my own words
  • 0.5 pts for using examples
  • 0.5 pts for my review ticket looking nice

  • Selection: The particular section of code that will run based on whether the algorithm’s condition returns true or false.

  • Algorithm: A limited number of instructions that carry out a particular task.

  • Conditional Statement: a command that modifies the order of control by executing certain commands based on the status of a boolean.

  • Algorithm with conditional statments:

  • See my review ticket for niceness and images.

Hack 3: Nested statements

Classes at school reccomendation quiz

Flow Chart