Module 2: Programming Fundamentals That Transfer
- Use variables, conditionals, and loops correctly
- Write and call functions with parameters and return values
- Choose between common data structures like arrays and objects/dictionaries
Every programming language differs in syntax but shares the same underlying logic, which is why learning fundamentals deeply pays off far more than memorizing one language's quirks. Variables store values; conditionals (if/else) let a program make decisions; loops (for/while) repeat an action without rewriting the same code many times. Functions package logic into a reusable, named block that takes inputs (parameters) and produces an output (a return value), which is how large programs stay organized instead of becoming one giant unreadable block. You will also compare two foundational data structures: arrays/lists, which hold ordered items, and objects/dictionaries, which store key-value pairs, and learn to choose the right one for a given problem.
1. To store a list of ordered items, such as a sequence of student scores, you would typically use a(n):
2. A function's 'return value' refers to:
3. A loop is primarily used to: