Printable worksheet ยท 2 of 4
Input needs validation before arithmetic - Paper 2
Read the information, then answer the questions. An adult may read the instructions aloud. Show your working where asked.
Read before answering
Fictional quantity entry is '20' (quotes delimit text; '' is empty). Accept only one or more ASCII digits 0 through 9, with the resulting integer between 0 and 20 inclusive. Reject all other input. Check text format before int conversion, then check range before calculating quantity + 1. Never use a real age, password or contact detail.
Worksheet preview
This exercise is included in the paid course. Full-course fee: GBP 200.00 once. Register and enrol to complete all course exercises and download the course PDFs. Access begins after payment is confirmed.
Already registered? Sign in