Week 2 - Control Structures and Programming Foundations
This week keeps building the foundations underneath your code. The module introduces if/else logic and loops, while the linked question pages consolidate the data types, variables and operators that make those control structures work.
Key knowledge and skills
- data types, variables and initialisation
- arithmetic, logical and conditional operators
- sequence, selection and iteration
- writing conditions that produce the correct branch or output
- developing a working solution with appropriate language features
Coding principles covered
- conditions should be specific and test only what matters
==compares values, while=assigns a value- loop boundaries should be deliberate to avoid off-by-one errors
- related data should be stored consistently so the loop can process it safely
Useful theory pages
Task checklist
- [ ] Open the Week 2 programming task outline and complete the
Week2_Controlconsole app module. - [ ] If time allows, add prices and an out-of-stock count as the extension.
- [ ] Complete Section 3 Test Your Knowledge.
- [ ] Complete Section 3 Applied Task.
- [ ] Upload your control-structure program and your Section 3 responses to your GitHub repo.