GRADE 8 · COMPUTING · UNIT 1 · LESSON 1.35
Computational thinking and programming
Round with floor and ceiling
Read a little. Try the workbook. Check your answers. Choose one section below to get started.
LET’S TRACE, REASON AND TEST
Round with floor and ceiling
Floor rounds down toward negative infinity, while ceiling rounds up toward positive infinity. They do not simply remove the decimal digits, especially for negative values. Locate the value between neighbouring integers.
- Predict, store and output returned values; use both rounding directions in a program.
- Explain my method and support it with a labelled trace, example or test record.

Work through an example
For 2.4, floor is 2 and ceiling is 3. For -2.4, floor is -3 and ceiling is -2 because down and up refer to the number line.
Try before your workbook
What are floor(-3.2) and ceiling(-3.2)? Explain their positions.
Explore the clues
Tap one card to find out more.
Understand the idea
Floor rounds down toward negative infinity, while ceiling rounds up toward positive infinity. They do not simply remove the decimal digits, especially for negative values. Locate the value between neighbouring integers.
Concept to practise: Round with floor and ceiling.
Work through an example
For 2.4, floor is 2 and ceiling is 3. For -2.4, floor is -3 and ceiling is -2 because down and up refer to the number line.
Try before your workbook
What are floor(-3.2) and ceiling(-3.2)? Explain their positions.
Check my readiness thinking
They are -4 and -3. The floor is the greatest integer no greater than the value; the ceiling is the least integer no less than it.
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.
Round in a specified direction
Down means toward smaller values on a number line; up means toward larger values. These are directional operations, not rounding to the nearest integer. An exact integer stays unchanged with either operation.
Read both directions on a number line

Read this model’s labels and values
Replace floor calls with their returned integers
| Original statement | After substitution |
|---|---|
| print(math.floor(18.9)) | {'clue': 'Rewritten statement', 'prompt': 'Substituted floor print', 'answers': ['print(18)']} |
| low = math.floor(6.4) | {'clue': 'Rewritten statement', 'prompt': 'Substituted low assignment', 'answers': ['low = 6']} |
| next_low = math.floor(-2.4) | {'clue': 'Rewritten statement', 'prompt': 'Substituted negative floor', 'answers': ['next_low = -3']} |
| total = math.floor(0.7) + math.floor(4.8) | {'clue': 'Rewritten statement', 'prompt': 'Substituted two floor calls', 'answers': ['total = 0 + 4']} |
Read a complete floor-answer check
Original Paxa floor quiz
import math
number = 8.6
print("Round", number, "down")
answer = int(input())
if answer == math.floor(number):
print("Answer matches")
else:
print("Try again")Predict the floor quiz feedback
| Input answer | Final feedback |
|---|---|
| 8 | {'clue': 'Exact message', 'prompt': 'Floor quiz feedback for 8', 'answers': ['Answer matches']} |
| 9 | {'clue': 'Exact message', 'prompt': 'Floor quiz feedback for 9', 'answers': ['Try again']} |
| 7 | {'clue': 'Exact message', 'prompt': 'Floor quiz feedback for 7', 'answers': ['Try again']} |
| 80 | {'clue': 'Exact message', 'prompt': 'Floor quiz feedback for 80', 'answers': ['Try again']} |
Store a return and add a second question
Original Paxa two-question stored-return version
import math
number = 8.6
expected = math.floor(number)
print("Round", number, "down")
answer = int(input())
if answer == expected:
print("Answer matches")
else:
print("Try again")
second = -2.4
expected_second = math.floor(second)
print("Round", second, "down")
answer_second = int(input())
if answer_second == expected_second:
print("Answer matches")
else:
print("Try again")Add two separately rounded-down inputs
| First | Second | Total after separate floors |
|---|---|---|
| 4.8 | 2.9 | {'clue': 'Integer', 'prompt': 'Floor sum4.8and2.9', 'answers': ['6']} |
| -0.2 | 2.1 | {'clue': 'Integer', 'prompt': 'Floor sum-0.2and2.1', 'answers': ['1']} |
| -0.2 | -2.1 | {'clue': 'Integer', 'prompt': 'Floor sum-0.2and-2.1', 'answers': ['-4']} |
Original Paxa sum of two floor results
import math
first = float(input())
second = float(input())
first_down = math.floor(first)
second_down = math.floor(second)
total = first_down + second_down
print("Total:", total)Replace ceiling calls with returned integers
| Original statement | After substitution |
|---|---|
| print(math.ceil(18.1)) | {'clue': 'Rewritten statement', 'prompt': 'Substituted ceiling print', 'answers': ['print(19)']} |
| high = math.ceil(6.4) | {'clue': 'Rewritten statement', 'prompt': 'Substituted high assignment', 'answers': ['high = 7']} |
| next_high = math.ceil(-2.4) | {'clue': 'Rewritten statement', 'prompt': 'Substituted negative ceiling', 'answers': ['next_high = -2']} |
| total = math.ceil(0.7) + math.ceil(4.8) | {'clue': 'Rewritten statement', 'prompt': 'Substituted two ceiling calls', 'answers': ['total = 1 + 5']} |
Read a complete ceiling-answer check
Original Paxa ceiling quiz
import math
number = 18.2
print("Round", number, "up")
answer = int(input())
if answer == math.ceil(number):
print("Answer matches")
else:
print("Try again")Predict the ceiling quiz feedback
| Input answer | Final feedback |
|---|---|
| 17 | {'clue': 'Exact message', 'prompt': 'Ceiling quiz feedback for 17', 'answers': ['Try again']} |
| 18 | {'clue': 'Exact message', 'prompt': 'Ceiling quiz feedback for 18', 'answers': ['Try again']} |
| 19 | {'clue': 'Exact message', 'prompt': 'Ceiling quiz feedback for 19', 'answers': ['Answer matches']} |
| 20 | {'clue': 'Exact message', 'prompt': 'Ceiling quiz feedback for 20', 'answers': ['Try again']} |
Choose up or down with valid selection
Original Paxa direction selector
import math
number = float(input())
direction = input().strip().lower()
if direction == "up":
print("Rounded:", math.ceil(number))
elif direction == "down":
print("Rounded:", math.floor(number))
else:
print("Invalid direction")Test both directions and exact integers
| Number | Direction | Returned integer |
|---|---|---|
| 3.2 | up | {'clue': 'Integer', 'prompt': 'Selector result 3.2 up', 'answers': ['4']} |
| 3.2 | down | {'clue': 'Integer', 'prompt': 'Selector result 3.2 down', 'answers': ['3']} |
| -2.4 | up | {'clue': 'Integer', 'prompt': 'Selector result -2.4 up', 'answers': ['-2']} |
| -2.4 | down | {'clue': 'Integer', 'prompt': 'Selector result -2.4 down', 'answers': ['-3']} |
| 7.0 | up | {'clue': 'Integer', 'prompt': 'Selector result 7.0 up', 'answers': ['7']} |
| 7.0 | down | {'clue': 'Integer', 'prompt': 'Selector result 7.0 down', 'answers': ['7']} |
Check both ceiling and floor answers
Original Paxa two-direction quiz
import math
number = 6.4
print("Round", number, "up")
up_answer = int(input())
up_ok = up_answer == math.ceil(number)
print("Round", number, "down")
down_answer = int(input())
down_ok = down_answer == math.floor(number)
if up_ok and down_ok:
print("Both match")
elif up_ok:
print("Ceiling matches")
elif down_ok:
print("Floor matches")
else:
print("Neither matches")Trace both stored rounding checks
| Up | Down | up_ok | down_ok | Feedback |
|---|---|---|---|---|
| 7 | 6 | {'clue': 'Boolean', 'prompt': 'Up flag 7/6', 'answers': ['True']} | {'clue': 'Boolean', 'prompt': 'Down flag 7/6', 'answers': ['True']} | {'clue': 'Final message', 'prompt': 'Two-direction feedback 7/6', 'answers': ['Both match']} |
| 6 | 6 | {'clue': 'Boolean', 'prompt': 'Up flag 6/6', 'answers': ['False']} | {'clue': 'Boolean', 'prompt': 'Down flag 6/6', 'answers': ['True']} | {'clue': 'Final message', 'prompt': 'Two-direction feedback 6/6', 'answers': ['Floor matches']} |
| 7 | 7 | {'clue': 'Boolean', 'prompt': 'Up flag 7/7', 'answers': ['True']} | {'clue': 'Boolean', 'prompt': 'Down flag 7/7', 'answers': ['False']} | {'clue': 'Final message', 'prompt': 'Two-direction feedback 7/7', 'answers': ['Ceiling matches']} |
| 6 | 7 | {'clue': 'Boolean', 'prompt': 'Up flag 6/7', 'answers': ['False']} | {'clue': 'Boolean', 'prompt': 'Down flag 6/7', 'answers': ['False']} | {'clue': 'Final message', 'prompt': 'Two-direction feedback 6/7', 'answers': ['Neither matches']} |
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 1 learning path
- Lesson 1.1: Recall algorithms and representations
- Lesson 1.2: Purpose and conventions of pseudocode
- Lesson 1.3: Input, output and strings
- Lesson 1.4: Identifiers and assignment
- Lesson 1.5: Arithmetic and translation
- Lesson 1.6: Trace and review a sequence
- Lesson 1.7: Conditions and two-way flow
- Lesson 1.8: IF THEN and indentation
- Lesson 1.9: IF THEN ELSE and decision diagrams
- Lesson 1.10: Ordered ELSEIF and fallback ELSE
- Lesson 1.11: Match flowchart and pseudocode branches
- Lesson 1.12: AND, OR and NOT
- Lesson 1.13: Grouping, precedence and review
- Lesson 1.14: Why software searches
- Lesson 1.15: A successful linear search
- Lesson 1.16: An unsuccessful search and termination
- Lesson 1.17: Practise and communicate the search
- Lesson 1.18: Translate conditions into Python
- Lesson 1.19: One-branch IF programs
- Lesson 1.20: Two-way IF ELSE programs
- Lesson 1.21: Ordered ELIF choices
- Lesson 1.22: Ranges and independent decisions
- Lesson 1.23: Boolean operators in Python
- Lesson 1.24: Design and test recommendations
- Lesson 1.25: Trace, debug and reflect
- Lesson 1.26: Choose data types and recognise Boolean literals
- Lesson 1.27: Set and use Boolean flags
- Lesson 1.28: Explain and identify constants
- Lesson 1.29: Express constants in three algorithm forms
- Lesson 1.30: Use a fixed factor in a calculation
- Lesson 1.31: Cast to Boolean and validate an empty response
- Lesson 1.32: Recall calls and trace return values
- Lesson 1.33: Supply parameters and reuse library code
- Lesson 1.34: Choose and import libraries responsibly
- Lesson 1.35: Round with floor and ceiling
- Lesson 1.36: Use pi and investigate another mathematical feature
- Lesson 1.37: Generate random choices within bounds
- Lesson 1.38: Investigate random real values and review library use
- Lesson 1.39: Retrieve test tables and predict selection outcomes
- Lesson 1.40: Decompose everyday problems
- Lesson 1.41: Decompose programs and organise shared work
- Lesson 1.42: Develop through repeated build/test cycles
- Lesson 1.43: Predict and verify algorithm outcomes
- Lesson 1.44: Choose representative and boundary tests
- Lesson 1.45: Build, execute and review a test plan
- Lesson 1.46: Recall physical inputs and compare transmission media
- Lesson 1.47: Configure a radio group and agree a message scheme
- Lesson 1.48: Send and receive numbers and strings
- Lesson 1.49: Trace numeric message sequences
- Lesson 1.50: Transmit text and use received data in conditions
- Lesson 1.51: Diagnose and extend a message protocol
- Lesson 1.52: Review communication and evidence of testing
- Lesson 1.53: Project 1: Adventure story
- Lesson 1.54: Project 2: Fire, Water, Earth
- Lesson 1.55: Check your progress 1
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 16 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.4 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 16 worksheets
Worksheet 1
- Question 1: Which operation rounds toward the smaller integer? math.floor()
- Question 2: What happens to the exact value 7.0 under either operation? both return integer 7
Worksheet 2
This page introduces the activity. There are no marked responses on this sheet.
Worksheet 3
- Question 3: Substituted floor print print(18)
- Question 4: Substituted low assignment low = 6
- Question 5: Substituted negative floor next_low = -3
- Question 6: Substituted two floor calls total = 0 + 4
Worksheet 4
- Question 7: Which complete line imports the library? import math
- Question 8: What library function is called in the comparison? math.floor / math.floor()
- Question 9: Where is its return value used here? directly in the equality comparison
Worksheet 5
- Question 10: Floor quiz feedback for 8 Answer matches
- Question 11: Floor quiz feedback for 9 Try again
- Question 12: Floor quiz feedback for 7 Try again
- Question 13: Floor quiz feedback for 80 Try again
- Question 14: What integer does math.floor(8.6) return? 8
Worksheet 6
This page introduces the activity. There are no marked responses on this sheet.
Worksheet 7
- Question 15: Floor sum4.8and2.9 6
- Question 16: Floor sum-0.2and2.1 1
- Question 17: Floor sum-0.2and-2.1 -4
Worksheet 8
- Question 18: Substituted ceiling print print(19)
- Question 19: Substituted high assignment high = 7
- Question 20: Substituted negative ceiling next_high = -2
- Question 21: Substituted two ceiling calls total = 1 + 5
Worksheet 9
- Question 22: Which library is imported? math
- Question 23: Which function supplies the comparison’s expected value? math.ceil / math.ceil()
- Question 24: Where is that returned value used in this program? directly in the equality comparison
Worksheet 10
- Question 25: Ceiling quiz feedback for 17 Try again
- Question 26: Ceiling quiz feedback for 18 Try again
- Question 27: Ceiling quiz feedback for 19 Answer matches
- Question 28: Ceiling quiz feedback for 20 Try again
- Question 29: If number changes to 18.0, what does ceil return? 18
Worksheet 11
- Question 30: Which input direction selects floor after normalisation? the word DOWN with spaces before and after
- Question 31: What does the program print for direction sideways? Invalid direction
Worksheet 12
- Question 32: Selector result 3.2 up 4
- Question 33: Selector result 3.2 down 3
- Question 34: Selector result -2.4 up -2
- Question 35: Selector result -2.4 down -3
- Question 36: Selector result 7.0 up 7
- Question 37: Selector result 7.0 down 7
Worksheet 13
This page introduces the activity. There are no marked responses on this sheet.
Worksheet 14
- Question 38: Up flag 7/6 True
- Question 39: Down flag 7/6 True
- Question 40: Two-direction feedback 7/6 Both match
- Question 41: Up flag 6/6 False
- Question 42: Down flag 6/6 True
- Question 43: Two-direction feedback 6/6 Floor matches
- Question 44: Up flag 7/7 True
- Question 45: Down flag 7/7 False
- Question 46: Two-direction feedback 7/7 Ceiling matches
- Question 47: Up flag 6/7 False
- Question 48: Down flag 6/7 False
- Question 49: Two-direction feedback 6/7 Neither matches
Worksheet 15
- Question 50: Annotate the page 4 floor quiz to identify import, module, function call, argument and use of the returned value. Predict and test its four page 5 answers or record actual execution Pending. Change its number to 5.25, store the expected floor in a named variable before testing, and add a second question for -2.4. Then use the page 13 ceiling-and-floor extension to trace all four page 14 input pairs and explain the flags and feedback. Keep full sources, predictions, actual results or Pending, corrections and retests, describing any actual paired or individual work. Original floor return 8; feedback for8 matches,9/7/80 Try again, full question precedes feedback. import math; module math; math.floor(number); argument number’s value; return used in answer equality. Changed number5.25 expected5 stored separately; second -2.4 expected-3. Complete code uses valid integer answers and correct comparisons/messages. Two-direction6.4 expects7/6; four flags/feedback as table: True/True Both match;False/True Floor matches;True/False Ceiling matches;False/False Neither matches. Full sources/predictions/actual or Pending, correction/retest evidence and honest roles. No numeric scores or invented execution. Grown-up review; personal evidence is required.
Worksheet 16
- Question 51: Create or adapt two programs: one reads two valid finite real numbers and outputs the sum of their separately rounded-down integers; the other reads one real number and an up/down choice and outputs the chosen directional result. Use the complete examples on pages 7 and 11 as support. Test every supplied input pair and direction case, plus an unknown direction, with predictions and actual output or Pending. Explain the difference between adding two floors and flooring a sum, using -0.2 and -2.1 as evidence. Keep complete code, test records and one correction or next step. Two-floor sum uses math.floor on each input before addition:4.8/2.9 ->6;-0.2/2.1 ->1;-0.2/-2.1 ->-4. By contrast floor(-0.2+-2.1) is-3, showing non-equivalence. Selector uses math.ceil forup,math.floor fordown, exact integer unchanged; cases3.2up4/down3,-2.4up-2/down-3,7.0both7. Normalised direction may accept padded uppercase; unknown ->Invalid direction, no fabricated numeric result. Valid finite float input assumption, integer return/results, imported module and valid selection. Full code, predictions/actual or Pending, correction/retest and next step. No GUI or hardware test inferred. Grown-up review; personal evidence is required.
Curriculum & workbook reference
- Cambridge Lower Secondary Computing Learner’s Book 8 — pages 138–142
- PaxaKids Grade 8 Computing Lesson 1.35: Round with floor and ceiling — pages 1–16
Computing for your homeschool day
Explore Round with floor and ceiling 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.
