GRADE 8 · COMPUTING · UNIT 2 · LESSON 2.8
Managing data
Length and range checks
Read a little. Try the workbook. Check your answers. Choose one section below to get started.
LET’S TRACE, REASON AND TEST
Length and range checks
Length checks constrain character counts; range checks constrain allowed values. State whether boundaries are inclusive and test them. Back up a database before changing a field size that could truncate existing data.
- Set appropriate bounds and test ordinary, boundary and invalid inputs.
- Explain my method and support it with a labelled trace, example or test record.

Work through an example
For a rating restricted to integers from 1 to 4 inclusive, 1 and 4 are valid boundaries, while 0 and 5 are invalid. A title-length limit is a different kind of rule.
Try before your workbook
Which check suits a score from 1 to 4, and should 4 be accepted?
Explore the clues
Tap one card to find out more.
Understand the idea
Length checks constrain character counts; range checks constrain allowed values. State whether boundaries are inclusive and test them. Back up a database before changing a field size that could truncate existing data.
Concept to practise: Length and range checks.
Work through an example
For a rating restricted to integers from 1 to 4 inclusive, 1 and 4 are valid boundaries, while 0 and 5 are invalid. A title-length limit is a different kind of rule.
Try before your workbook
Which check suits a score from 1 to 4, and should 4 be accepted?
Check my readiness thinking
Use a range check with inclusive endpoints, and accept 4. A length check alone would not express the numeric rule.
Your original programs and learning models
These original PaxaKids program and data models support your workbook. Some examples deliberately contain faults to investigate. Follow their headings and preserve exact code case, punctuation and order. Traces and supplied records are not claims of physical testing.
Choose limits that suit the purpose
Continue the original fictional BookNotes practice. We will keep the presence checks and generated key, then add explicit text-length rules, numeric bounds and whole-number checks. Use the supplied PresenceReady copy or your correctly configured previous version.
Keep the complete starting data and types
These three fictional seed records are unchanged. Work on a copy and preserve them while testing new entries.
| Note_ID | Alias | Age | Book title | Minutes |
|---|---|---|---|---|
| 1 | Raven | 12 | Star Atlas | 25 |
| 2 | Maple | 11 | River Tale | 40 |
| 3 | Cedar | 13 | Sky Lab | 35 |
Specify four clear classroom constraints
| Field | Accepted value |
|---|---|
| Reader_alias | 1–25 characters |
| Book_title | 1–80 characters |
| Reader_age | Whole number from 0 to 18 inclusive |
| Reading_minutes | Whole number from 1 to 180 inclusive |
Set explicit rules and useful messages
Keep text capacity 255 here and use the explicit Len rules shown here to reject overlong entries. A smaller Field Size can limit typing or shorten imported text, so always inspect the saved value. Reference: Microsoft validation guidance.
BookNotes field validation rules
Reader_alias (Short Text, capacity 255):
Len([Reader_alias]) Between 1 And 25
Book_title (Short Text, capacity 255):
Len([Book_title]) Between 1 And 80
Reader_age (Number, Double):
Between 0 And 18 And
Int([Reader_age])=[Reader_age]
Reading_minutes (Number, Double):
Between 1 And 180 And
Int([Reading_minutes])=[Reading_minutes]Predict duration tests around both boundaries
| Reading_minutes | Expected decision |
|---|---|
| 60: ordinary value | {'clue': 'Decision', 'prompt': 'Minutes 60', 'answers': ['Accept']} |
| 1: lower boundary | {'clue': 'Decision', 'prompt': 'Minutes 1', 'answers': ['Accept']} |
| 180: upper boundary | {'clue': 'Decision', 'prompt': 'Minutes 180', 'answers': ['Accept']} |
| 0: just below | {'clue': 'Decision', 'prompt': 'Minutes 0', 'answers': ['Reject']} |
| 181: just above | {'clue': 'Decision', 'prompt': 'Minutes 181', 'answers': ['Reject']} |
| 1.5: in range but fractional | {'clue': 'Decision', 'prompt': 'Minutes 1.5', 'answers': ['Reject']} |
Extend the test plan to the age field
| Reader_age | Expected decision |
|---|---|
| 0: lower boundary | {'clue': 'Decision', 'prompt': 'Age 0', 'answers': ['Accept']} |
| 18: upper boundary | {'clue': 'Decision', 'prompt': 'Age 18', 'answers': ['Accept']} |
| −1: just below | {'clue': 'Decision', 'prompt': 'Age -1', 'answers': ['Reject']} |
| 19: just above | {'clue': 'Decision', 'prompt': 'Age 19', 'answers': ['Reject']} |
| 12.5: fractional value | {'clue': 'Decision', 'prompt': 'Age 12.5', 'answers': ['Reject']} |
Read feedback and inspect what was saved
Passing the rule means the value meets that rule. A fictional note with 30 minutes might pass every rule yet still disagree with its source. Keep validation and source verification separate.
Test text lengths without losing characters
| Proposed field content | Expected decision |
|---|---|
| Reader_alias: A repeated 25 times | {'clue': 'Decision', 'prompt': 'Alias length 25', 'answers': ['Accept']} |
| Reader_alias: A repeated 26 times | {'clue': 'Decision', 'prompt': 'Alias length 26', 'answers': ['Reject']} |
| Book_title: B repeated 80 times | {'clue': 'Decision', 'prompt': 'Title length 80', 'answers': ['Accept']} |
| Book_title: B repeated 81 times | {'clue': 'Decision', 'prompt': 'Title length 81', 'answers': ['Reject']} |
Files for this activity
Use these original PaxaKids practice files with the matching workbook. Work on a local copy in the appropriate editor. Some examples deliberately contain faults to investigate; a downloaded file is not a completed practical test.

Try one step with Paxa!
Trace code in the stated order and preserve exact spelling and case. Use fictional data. Label a prediction, paper trace, simulator run and physical-device test separately; an unperformed test stays Pending. Save personal responses before leaving.
Our Unit 2 learning path
- Lesson 2.1: Models, simulators and useful features
- Lesson 2.2: Data for users and model designers
- Lesson 2.3: Spreadsheet models and what-if changes
- Lesson 2.4: Goal seek and checking a target
- Lesson 2.5: Data requirements and completeness
- Lesson 2.6: Fields, records and consistent formats
- Lesson 2.7: Presence checks and primary keys
- Lesson 2.8: Length and range checks
- Lesson 2.9: A validated entry form
- Lesson 2.10: Evaluating and designing a database
- Lesson 2.11: Project: Presentation time!
- Lesson 2.12: Check your progress 2
For grown-ups: using this lesson
Your answers are checked in your browser. Open responses need grown-up review and are shown separately from the automatic score. Check your work, then use “Retry answers to practise” to revisit mistakes while keeping correct responses.
Read one explanation, discuss the model and try the readiness check before the workbook. Choose “Mark lesson finished” when ready. Optional account progress saves lesson position and completion across devices; save personal responses before leaving.
2. Fill in your workbook
Read the teaching and complete workbook instructions. Choose, write or draw; Answer list offers larger controls. Trace code precisely and distinguish predictions from actual tests. Review designs, explanations and drawings with a grown-up.
Opening your PDF…
Swipe sideways across the worksheet on a small screen, or use “Answer list” for larger controls.
You’ve completed the checked activities.
TAKE YOUR PRACTICE OFFLINE
3. Download the student worksheet
All 10 original A4 student pages, ready for pencil-and-paper practice. Choose Review Answers to check your work on this webpage.
Student worksheet only · PDF · 8.5 MiB · No answer key included
TRY FIRST, THEN CHECK TOGETHER
Download the student worksheet →4. Answers & guidance
Finished your try? Open the guide and compare one worksheet at a time. Your own words may be different and still explain the right idea.
Shown on this webpage only. There is no answer-key download, and this guide is left out when printing the page.
Show answers for all 10 worksheets
Worksheet 1
- Question 1: Which describes a length check? a rule about how many characters text contains
Worksheet 2
- Question 2: Which field remains the automatically generated primary key? Note_ID
- Question 3: How many reading minutes are recorded for Raven? 25
Worksheet 3
- Question 4: What is the smallest allowed Reading_minutes value? 1
- Question 5: What is the largest allowed Reading_minutes value? 180
Worksheet 4
- Question 6: Why include Int(field)=field with the numeric bounds? to reject fractions that lie inside the range
Worksheet 5
- Question 7: Minutes 60 Accept
- Question 8: Minutes 1 Accept
- Question 9: Minutes 180 Accept
- Question 10: Minutes 0 Reject
- Question 11: Minutes 181 Reject
- Question 12: Minutes 1.5 Reject
Worksheet 6
- Question 13: Age 0 Accept
- Question 14: Age 18 Accept
- Question 15: Age -1 Reject
- Question 16: Age 19 Reject
- Question 17: Age 12.5 Reject
- Question 18: Would a range-only rule of 0 to 18 necessarily reject 12.5? no; 12.5 is in range
Worksheet 7
- Question 19: What is the strongest conclusion after an entry passes these checks? it meets the implemented rules; its truth still needs checking
Worksheet 8
- Question 20: Alias length 25 Accept
- Question 21: Alias length 26 Reject
- Question 22: Title length 80 Accept
- Question 23: Title length 81 Reject
- Question 24: Before lowering a text capacity on existing data, what should you do? preserve a copy and check existing lengths for possible data loss
Worksheet 9
- Question 25: Use the complete original BookNotes model on page 2 and a working copy of PresenceReady. Apply the four page 4 field rules and clear messages while keeping the presence rules, text capacity 255 and generated key. Predict and run the six duration, five age and four length cases on pages 5–6 and 8, plus a new record with a Null title to confirm presence remains enforced. Test independently and preserve seed data. Record actual accept/reject outcomes, messages, saved values or Pending, differences, corrections and retests. If no database tool is available, complete the paper settings and test plan and mark execution Pending. Keep source/settings/log evidence and cite it here. All four explicit rules and useful messages, required fields and no zero-length text retained. Duration60/1/180 accepted;0/181/1.5 rejected. Age0/18 accepted;-1/19/12.5 rejected. Alias25 accepted/26 rejected;title80 accepted/81 rejected;Null title rejected. Numeric Double plus Int equality prevents silently rounded fractions. Text capacity255 plus Len rules rejects overlong text without accepting a shortened value. All cases independent, seeds preserved, actual learner database evidence or honest paper/Pending, expected/actual/messages/saved-value checks and meaningful correction/retest retained. Author native DAO tests are not learner GUI completion. Grown-up review; personal evidence is required.
Worksheet 10
- Question 26: Explain the purpose of a length check and a range check using your own BookNotes examples. Explain why inclusive bounds, whole-number rules and presence rules are separate. Propose one additional appropriate field with a justified length or numeric rule, ordinary/boundary/invalid tests and expected outcomes. Review how you followed setup steps, observed useful error messages, explained a rule, extended it and remembered the method. For each point cite actual evidence or state what remains Pending, using descriptions rather than ratings. Record actual partner/teacher feedback or Pending, one improvement and your next step. Attach full work and cite it here. Correct length/range/presence/integer distinctions and original examples; inclusive endpoints accepted, fractional values not assumed impossible merely because bounds are whole. Additional purpose-relevant field and justified rule with ordinary/boundary/invalid tests. Evidence-based review of all five source skill areas without score/confidence rating. Clear limits of validation versus source truth, preserving data when changing capacity, actual review or Pending and an actionable improvement/next step. Retained own source, test and explanation evidence. Grown-up review; personal evidence is required.
Curriculum & workbook reference
- Cambridge Lower Secondary Computing Learner’s Book 8 — pages 220–221
- PaxaKids Grade 8 Computing Lesson 2.8: Length and range checks — pages 1–10
Computing for your homeschool day
Explore Length and range checks with this free Grade 8 Computing lesson. Read one idea together, try the fillable workbook and return to review at your own pace. Download the same student worksheet PDF for pencil-and-paper practice.
Fit learning around your family’s day. There is no timer and no sign-up is needed to use the lesson. An optional account saves your lesson position and completion across devices. Workbook responses and drawings stay in this tab; save a copy of your responses before leaving.
Understand your results
Closed answers are checked in your browser. Drawings and written explanations need grown-up review and are shown separately from the automatic score. Check your work, then use “Retry answers to practise” to revisit mistakes while keeping correct responses.
Choose Review Answers after trying the activity. The guide stays on the webpage; the worksheet download contains only the student pages.
For programme background, visit the Cambridge Lower Secondary Computing overview. PaxaKids provides independent original companion practice.
Book page references identify the related teaching topic. File-management and responsible-data preparation are original PaxaKids material; orientation or contents pages are not presented as teaching citations for those skills. The explanations, characters, programs and exercises here are original PaxaKids companion practice. Practical tasks require the appropriate editor and, where applicable, suitable equipment. A design or paper trace is not a verified hardware result. Only completed, reviewed lessons are listed.
Explore the Cambridge Lower Secondary Computing curriculum for programme background. PaxaKids is an independent learning resource.
