Computational Thinking
- Approaching a problem so a computer could help solve
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:
- Getting a user from the database
- Checking if the user has the ADMIN role
- 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:
- Crack 2 eggs
- Whisk the eggs
- Pour into pan
- Scramble with spatula until done
- Example Pseudocode:
- Get two eggs
- Get a bowl
- Get spatula
- Get pan
- Get stove
- Loop twice:
- Crack egg into bowl
- Whisk until homogenous
- Heat pan on medium heat
- Add 1 tablespoon of butter to pan
- Pour contents of bowl into pan
- Scramble with spatula until cooked
- 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']