|
"A program is a way to tell a computer what you want it to do, also known as 'tasks'"
All programming languages share a common set of 'foundations' to performs tasks.
Some common foundations are:
- storing information
- Names: "John Doe", "Jane Smith"
- Numbers: "123", "4.56"
- displaying content
- Text: "Hello World", "Welcome"
- Graphics:
- receiving input
- Keyboard: Pressing keys.
Example: pressing a letter, like 'g', number, like '7', or a special character, like '&' (ampersand)
- Mouse: Moving the mouse, clicking one of its buttons.
- performing logic
- If then do: If something is true, then do something else.
Example: If GB eats all of the cookies in the jar, put a lock on the jar.
With this logic, the jar will be checked. If there are still cookies, it will remain unlocked. But, once all of the cookies are gone, a lock will automatically be placed on it.
- Do until: Do something until something else happens.
Example: Keep making cookies until GB gets full.
With this logic, GB will be continually checked. If he isn't full, cookies will continue to be cooked. Once he says he is full, the cooking will stop.
|