Week 5 - Validation and Reliable Input
This week focuses on reliable user input. The coding task uses validation methods, while the theory work draws on Section 4 ideas about selection, iteration and validation order.
Key knowledge and skills
- existence, type and range checks
- repeated input using loops until valid data is entered
- methods that isolate validation logic
- designing software that rejects invalid data safely
- explaining why validation improves reliability but does not guarantee truth
Coding principles covered
- validate data before using it in calculations
- check existence, then type, then range
- use
TryParseinstead of risky direct conversion - keep validation logic reusable rather than rewriting it for each field
Useful theory pages
Task checklist
- [ ] Open the Week 5 programming task outline and complete the
Week5_Validationconsole app module. - [ ] Use
TryParseand range checks so the program keeps asking until valid input is entered. - [ ] Complete Section 4 Test Your Knowledge.
- [ ] Complete Section 4 Applied Task.
- [ ] Upload your validation program and your Section 4 responses to your GitHub repo.