Course: CSCI 1250

Assignment: Assignment 1 ‐ Algorithmic Thinking

Computational Thinking

  • Approaching a problem so a computer could help solve
    • Structured & logical

Algorithm

  • Ordered instructions to tell the computer how to do something
    • Has to be sequential & unambiguous/clear

Abstraction

  • Only including the important information; removing the unnecessary information
    • High Level → less information (Python)
    • Low Level → more information (C)

Decomposition

  • Breaking a problem into smaller parts
  • Breaking a large problem, such as only allowing admins to upload files to:
    1. Getting a user from the database
    2. Checking if the user has the ADMIN role
    3. Allowing the user to upload files

Pseudocode

  • Writing steps thats like “code”, but in words rather than a programming language
  • Assumptions are necessary for pseudocode
  • Example Instructions:
    1. Crack 2 eggs
    2. Whisk the eggs
    3. Pour into pan
    4. Scramble with spatula until done
  • Example Pseudocode:
    1. Get two eggs
    2. Get a bowl
    3. Get spatula
    4. Get pan
    5. Get stove
    6. Loop twice:
      1. Crack egg into bowl
    7. Whisk until homogenous
    8. Heat pan on medium heat
    9. Add 1 tablespoon of butter to pan
    10. Pour contents of bowl into pan
    11. Scramble with spatula until cooked
    12. Enjoy 😋

Flowcharts

  • A way to map out steps of an algorithm in a graphical form
flowchart TD

A(Begin)

--> B[/Numeric Grade/]

--> B1{grade > 90}

B1 -- YES --> C1[set grade to 'A']

B1 -- NO --> B2{grade > 80}

B2 -- YES --> C2[set grade to 'B']

B2 -- NO --> B3{grade > 70}

B3 -- YES --> C3[set grade to 'C']

B3 -- NO --> B4{grade > 60}

B4 -- YES --> C4[set grade to 'D']

B4 -- NO --> C5[set grade to 'F']