Hack 1

  1. algorithm: the algorithm describes the instructions to complete a task, which done by the graphic with a list of instructions to do

  2. sequencing: order of how to do something

    1. Set item to number to search for
    2. Get next number in list
    3. If number = item, display "item found"
    4. If more numbers in list, go back to step 2
    5. Display "item not found
  3. selection If the number = item, the algorithm selects the item.

  4. iteration The iteration loops through the list to find all the numbers equal to the item

Hack 2

num1 = 5
num2 = num1 * 3
num3 = num2 / num1 * (9 % 2) * 4
result = (num3 % num1 + num2) % num3 * 3 / 5
print(result)
3.0

Hack 3

1 down: iteration

2 down: selection

3 across: sequence

quiz

Notes

  • set of instruction that accomplishes a task
  • three part os algorithm: sequencing, selection, iteration
  • sequence: allows an algorithm to make a decision based on if a condition is met
  • iteration: a loop and performing a task until a condition is met

  • arithmetic: addition, subtraction, multiplication, division, modulus

  • strings: ordered sequences of characters

  • examples of strings in pseudocode:
    • len(str)
    • concat (str1, str2)
    • substring(str1, str2, length)- returns a substring of consecutive character from str 1 starting at the character at position 'start' and containing 'length' character