GRADE 8 · COMPUTING · UNIT 1 · LESSON 1.36

Computational thinking and programming

Use pi and investigate another mathematical feature

Read a little. Try the workbook. Check your answers. Choose one section below to get started.

Topic 1.36 · Use pi and investigate another mathematical feature13 fillable worksheet pagesRead at your own pace

LET’S TRACE, REASON AND TEST

Use pi and investigate another mathematical feature

Use library constants and functions according to the model. A circle's radius is half its diameter; area and circumference use different formulas and units. State the chosen approximation or library constant.

Today’s two goals
  • Access math.pi and select correct formulas for radius or diameter inputs.
  • Explain my method and support it with a labelled trace, example or test record.
Original PaxaKids illustration for Use pi and investigate another mathematical feature. Use the supplied program and data models for precise workbook facts.
An original PaxaKids workbook scene. Use the supplied programs and data for precise workbook facts.

Work through an example

With radius 3, area = pi × 3² = 9pi square units and circumference = 2 × pi × 3 = 6pi units. Using diameter 6 as the radius would be incorrect.

Try before your workbook

For radius 2, what are the area and circumference in terms of pi?

Explore the clues

Tap one card to find out more.

Understand the idea

Use library constants and functions according to the model. A circle's radius is half its diameter; area and circumference use different formulas and units. State the chosen approximation or library constant.

Concept to practise: Use pi and investigate another mathematical feature.

Work through an example

With radius 3, area = pi × 3² = 9pi square units and circumference = 2 × pi × 3 = 6pi units. Using diameter 6 as the radius would be incorrect.

Try before your workbook

For radius 2, what are the area and circumference in terms of pi?

Check my readiness thinking

Area is 4pi square units and circumference is 4pi units. They share a numerical coefficient here, but represent different quantities and units.

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.

Use pi as a numeric constant

math.pi is a floating-point approximation to the mathematical constant pi. Read it without parentheses after importing math. It is not a function call, and its stored value is more precise than the simple estimate 3.14.

Use radius and diameter carefully when calculating a circle’s area or circumference. The Python math guide documents the constant; the diagrams and formulas here identify the required measurement.

Distinguish radius, diameter and circumference

A radius runs from the centre to the circle. A diameter crosses the centre and spans the whole circle. Circumference is the distance around its boundary; area measures the enclosed surface.
Distinguish radius, diameter and circumference — original labelled workbook model. The following text version gives its labels and values.
Distinguish radius, diameter and circumference · original PaxaKids model.
Read this model’s labels and values

Predict an original fixed-radius program

This complete original program uses radius 3 in a common length unit. Its area is stored as a float and displayed to two decimal places. The formatting changes the display, rather than replacing the stored result with an exact two-decimal mathematical value.
Original Paxa fixed-radius example
import math
radius = 3
area = radius * radius * math.pi
print("Area:", f"{area:.2f}")

Compare a simple estimate with program precision

For each fresh run, set radius to the stated value in page 3. First estimate with 3.14 * radius * radius, then compare the program using math.pi. Both columns ask for two-decimal displays. A small difference can come from the chosen approximation, rather than an incorrect formula.
Compare a simple estimate with program precision — original model
RadiusUsing 3.14Using math.pi
2{'clue': 'Amount to two decimal places', 'prompt': 'Estimate for radius 2', 'answers': ['12.56']}{'clue': 'Amount to two decimal places', 'prompt': 'Program area for radius 2', 'answers': ['12.57']}
3{'clue': 'Amount to two decimal places', 'prompt': 'Estimate for radius 3', 'answers': ['28.26']}{'clue': 'Amount to two decimal places', 'prompt': 'Program area for radius 3', 'answers': ['28.27']}
5{'clue': 'Amount to two decimal places', 'prompt': 'Estimate for radius 5', 'answers': ['78.50']}{'clue': 'Amount to two decimal places', 'prompt': 'Program area for radius 5', 'answers': ['78.54']}
8{'clue': 'Amount to two decimal places', 'prompt': 'Estimate for radius 8', 'answers': ['200.96']}{'clue': 'Amount to two decimal places', 'prompt': 'Program area for radius 8', 'answers': ['201.06']}

Read a radius and report both measurements

This complete original modification reads a valid nonnegative finite radius, which may include decimals. It calculates both area and circumference. Zero is included as a useful mathematical boundary test; all measurements use a common length unit.
Original Paxa radius-input example
import math
radius = float(input())
area = math.pi * radius * radius
circumference = 2 * math.pi * radius
print("Area:", f"{area:.2f}")
print("Circumference:", f"{circumference:.2f}")

Test zero and a decimal radius

Use page 5 unchanged. Predict both displayed quantities to two decimal places. Area is in square units and circumference in length units.
Test zero and a decimal radius — original model
RadiusDisplayed areaDisplayed circumference
0{'clue': 'Amount to two decimal places', 'prompt': 'Area for input radius 0', 'answers': ['0.00']}{'clue': 'Amount to two decimal places', 'prompt': 'Circumference for input radius 0', 'answers': ['0.00']}
1{'clue': 'Amount to two decimal places', 'prompt': 'Area for input radius 1', 'answers': ['3.14']}{'clue': 'Amount to two decimal places', 'prompt': 'Circumference for input radius 1', 'answers': ['6.28']}
2.5{'clue': 'Amount to two decimal places', 'prompt': 'Area for input radius 2.5', 'answers': ['19.63']}{'clue': 'Amount to two decimal places', 'prompt': 'Circumference for input radius 2.5', 'answers': ['15.71']}

Choose radius or diameter, then area or circumference

Enter the measurement name, a valid nonnegative finite size, and the calculation name on three separate lines. This complete original program converts diameter to radius before applying either formula. Unknown text choices produce explicit messages.
Original Paxa circle-choice calculator
import math
measurement = input().strip().lower()
size = float(input())
calculation = input().strip().lower()
if measurement == "radius" or measurement == "diameter":
    if measurement == "radius":
        radius = size
    else:
        radius = size / 2
    if calculation == "area":
        result = math.pi * radius * radius
        print("Area:", f"{result:.2f}")
    elif calculation == "circumference":
        result = 2 * math.pi * radius
        print("Circumference:", f"{result:.2f}")
    else:
        print("Invalid calculation")
else:
    print("Invalid measurement")

Check all four valid choice combinations

Use page 7 unchanged. The first two rows enter radius 3; the next two enter diameter 6, describing an equal-size circle. Write the complete printed line.
Check all four valid choice combinations — original model
MeasurementSizeCalculationFull printed output
radius3area{'clue': 'Exact output', 'prompt': 'radius area output', 'answers': ['Area: 28.27']}
radius3circumference{'clue': 'Exact output', 'prompt': 'radius circumference output', 'answers': ['Circumference: 18.85']}
diameter6area{'clue': 'Exact output', 'prompt': 'diameter area output', 'answers': ['Area: 28.27']}
diameter6circumference{'clue': 'Exact output', 'prompt': 'diameter circumference output', 'answers': ['Circumference: 18.85']}

Investigate another documented math function

The sqrt guide describes square roots; for this example sqrt(81) returns 9.0. The fabs guide describes absolute value; fabs(-4.5) returns 4.5. Both are functions, unlike the pi constant. Use these starter sources or investigate a different suitable math function in the final task.
Original Paxa function-research starters
import math
print("Square root:", math.sqrt(81))
print("Absolute value:", math.fabs(-4.5))

Connect the original curriculum math toolkit

This complete original C06 program combines floor, ceiling, a parameterised circle-area function and the pi constant. Enter a finite number, then a radius. It rejects a negative radius. round(value, 3) rounds numerically to three decimal places; it does not force trailing zero digits in the printed text.
Original curriculum module C06 math toolkit
import math
def circle_area(radius):
    return math.pi * radius * radius
print("Enter a finite number and a nonnegative radius on separate lines.")
number = float(input())
radius = float(input())
print("Floor:", math.floor(number))
print("Ceiling:", math.ceil(number))
if radius < 0:
    print("Radius must be nonnegative.")
else:
    area = circle_area(radius)
    circumference = 2 * math.pi * radius
    print("Area:", round(area, 3))
    print("Circumference:", round(circumference, 3))

Trace the toolkit and its radius guard

Use page 10 with first input -2.4 and second input 3. Write only the value following each output label. The program’s initial instruction also prints before input. Keep the toolkit’s own numeric rounding convention.
Trace the toolkit and its radius guard — original model
Output labelPrinted numeric value
Floor:{'clue': 'Exact value', 'prompt': 'Toolkit floor for -2.4', 'answers': ['-3']}
Ceiling:{'clue': 'Exact value', 'prompt': 'Toolkit ceiling for -2.4', 'answers': ['-2']}
Area:{'clue': 'Exact displayed value', 'prompt': 'Toolkit area for radius3', 'answers': ['28.274']}
Circumference:{'clue': 'Exact displayed value', 'prompt': 'Toolkit circumference for radius3', 'answers': ['18.85']}

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.

Paxa the Fox

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
  1. Lesson 1.1: Recall algorithms and representations
  2. Lesson 1.2: Purpose and conventions of pseudocode
  3. Lesson 1.3: Input, output and strings
  4. Lesson 1.4: Identifiers and assignment
  5. Lesson 1.5: Arithmetic and translation
  6. Lesson 1.6: Trace and review a sequence
  7. Lesson 1.7: Conditions and two-way flow
  8. Lesson 1.8: IF THEN and indentation
  9. Lesson 1.9: IF THEN ELSE and decision diagrams
  10. Lesson 1.10: Ordered ELSEIF and fallback ELSE
  11. Lesson 1.11: Match flowchart and pseudocode branches
  12. Lesson 1.12: AND, OR and NOT
  13. Lesson 1.13: Grouping, precedence and review
  14. Lesson 1.14: Why software searches
  15. Lesson 1.15: A successful linear search
  16. Lesson 1.16: An unsuccessful search and termination
  17. Lesson 1.17: Practise and communicate the search
  18. Lesson 1.18: Translate conditions into Python
  19. Lesson 1.19: One-branch IF programs
  20. Lesson 1.20: Two-way IF ELSE programs
  21. Lesson 1.21: Ordered ELIF choices
  22. Lesson 1.22: Ranges and independent decisions
  23. Lesson 1.23: Boolean operators in Python
  24. Lesson 1.24: Design and test recommendations
  25. Lesson 1.25: Trace, debug and reflect
  26. Lesson 1.26: Choose data types and recognise Boolean literals
  27. Lesson 1.27: Set and use Boolean flags
  28. Lesson 1.28: Explain and identify constants
  29. Lesson 1.29: Express constants in three algorithm forms
  30. Lesson 1.30: Use a fixed factor in a calculation
  31. Lesson 1.31: Cast to Boolean and validate an empty response
  32. Lesson 1.32: Recall calls and trace return values
  33. Lesson 1.33: Supply parameters and reuse library code
  34. Lesson 1.34: Choose and import libraries responsibly
  35. Lesson 1.35: Round with floor and ceiling
  36. Lesson 1.36: Use pi and investigate another mathematical feature
  37. Lesson 1.37: Generate random choices within bounds
  38. Lesson 1.38: Investigate random real values and review library use
  39. Lesson 1.39: Retrieve test tables and predict selection outcomes
  40. Lesson 1.40: Decompose everyday problems
  41. Lesson 1.41: Decompose programs and organise shared work
  42. Lesson 1.42: Develop through repeated build/test cycles
  43. Lesson 1.43: Predict and verify algorithm outcomes
  44. Lesson 1.44: Choose representative and boundary tests
  45. Lesson 1.45: Build, execute and review a test plan
  46. Lesson 1.46: Recall physical inputs and compare transmission media
  47. Lesson 1.47: Configure a radio group and agree a message scheme
  48. Lesson 1.48: Send and receive numbers and strings
  49. Lesson 1.49: Trace numeric message sequences
  50. Lesson 1.50: Transmit text and use received data in conditions
  51. Lesson 1.51: Diagnose and extend a message protocol
  52. Lesson 1.52: Review communication and evidence of testing
  53. Lesson 1.53: Project 1: Adventure story
  54. Lesson 1.54: Project 2: Fire, Water, Earth
  55. 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.

Use pi and investigate another mathematical feature13 student pages · original artwork

Opening your PDF…

Swipe sideways across the worksheet on a small screen, or use “Answer list” for larger controls.

TAKE YOUR PRACTICE OFFLINE

3. Download the student worksheet

All 13 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.3 MiB · No answer key included

Download worksheet PDF ↓

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 13 worksheets

Worksheet 1

  1. Question 1: Which expression accesses the pi constant? math.pi
  2. Question 2: What is 3.14 in a manual circle calculation? an approximation to pi

Worksheet 2

This page introduces the activity. There are no marked responses on this sheet.

Worksheet 3

  1. Question 3: Which module is imported? math
  2. Question 4: What number follows Area: in the shown output? 28.27
  3. Question 5: Does reading math.pi call a function? no, it reads a numeric constant

Worksheet 4

  1. Question 6: Estimate for radius 2 12.56
  2. Question 7: Program area for radius 2 12.57
  3. Question 8: Estimate for radius 3 28.26
  4. Question 9: Program area for radius 3 28.27
  5. Question 10: Estimate for radius 5 78.50
  6. Question 11: Program area for radius 5 78.54
  7. Question 12: Estimate for radius 8 200.96
  8. Question 13: Program area for radius 8 201.06

Worksheet 5

  1. Question 14: What Python type does radius store here? float / real
  2. Question 15: For radius 3, what number follows Circumference:? 18.85
  3. Question 16: Which formula gives the circumference? 2 * math.pi * radius

Worksheet 6

  1. Question 17: Area for input radius 0 0.00
  2. Question 18: Circumference for input radius 0 0.00
  3. Question 19: Area for input radius 1 3.14
  4. Question 20: Circumference for input radius 1 6.28
  5. Question 21: Area for input radius 2.5 19.63
  6. Question 22: Circumference for input radius 2.5 15.71

Worksheet 7

This page introduces the activity. There are no marked responses on this sheet.

Worksheet 8

  1. Question 23: radius area output Area: 28.27
  2. Question 24: radius circumference output Circumference: 18.85
  3. Question 25: diameter area output Area: 28.27
  4. Question 26: diameter circumference output Circumference: 18.85
  5. Question 27: What happens for measurement width with any valid numeric size? Invalid measurement is printed

Worksheet 9

  1. Question 28: What value does math.sqrt(81) return here? 9.0 / 9
  2. Question 29: What value does math.fabs(-4.5) return? 4.5

Worksheet 10

This page introduces the activity. There are no marked responses on this sheet.

Worksheet 11

  1. Question 30: Toolkit floor for -2.4 -3
  2. Question 31: Toolkit ceiling for -2.4 -2
  3. Question 32: Toolkit area for radius3 28.274
  4. Question 33: Toolkit circumference for radius3 18.85
  5. Question 34: If radius is -1, what does the guard do? prints Radius must be nonnegative. and skips circle calculations

Worksheet 12

  1. Question 35: Use pages 3–8 to predict the fixed-radius outputs, recreate the radius-input area/circumference version and make or adapt a calculator that accepts radius or diameter and a choice of area or circumference. Test all four page 8 combinations, radius zero, radius 2.5 and an invalid measurement/calculation choice, recording predictions and actual output or Pending. Identify the import, numeric pi constant, inputs and stored results; explain conversion and units. Compare the toolkit’s numeric rounding with fixed decimal formatting. Keep full code, tests, corrections and retests. Correct formulas: diameter = 2 * radius; area = math.pi * radius * radius; circumference = 2 * math.pi * radius. Diameter input converts to radius by dividing by 2 before either formula. Valid equal-size cases radius 3 and diameter 6 give Area: 28.27 or Circumference: 18.85. Radius zero gives 0.00 and 0.00; radius 2.5 gives 19.63 and 15.71 with two-decimal display. Unknown choices give Invalid measurement or Invalid calculation. math.pi is a float approximation, not callable; inputs/results typed and common length/square units explained. Toolkit round(value, 3) does not pad zeros, while :.2f fixes two displayed digits. Full source/predictions/actual or Pending and correction/retest evidence required. Grown-up review; personal evidence is required.

Worksheet 13

  1. Question 36: Choose a math function beyond floor and ceil, such as sqrt or fabs from page 9. Read its official documentation and record the source title, URL and actual date checked, or identify provided-source reading with independent search Pending. Explain its purpose, arguments, input restrictions and returned type in your own words. Write a complete import/call/store-or-print example and predict at least two valid cases before execution or Pending. Compare with a partner’s different function if available; otherwise compare the two supplied starter features individually and mark partner exchange Pending. Keep code, evidence, your contribution and one next step. One suitable documented math function beyond floor/ceil; for sqrt use nonnegative finite inputs such as 81 and 0, returning floats 9.0 and 0.0; for fabs use -4.5 and 0, returning floats 4.5 and 0.0. Other documented appropriate functions accepted. Correct import, argument, call and use of returned value; not pi described as callable. Primary source title/URL/date or provided-reading/Pending distinction, original explanation of purpose/domain/type, two predictions and actual/Pending, corrections/retests. Actual comparison with a different peer feature or truthful individual sqrt/fabs comparison, contribution and next step. No invented web visit, partner round or installation. Grown-up review; personal evidence is required.
Back to my workbook ↑

Curriculum & workbook reference

Computing for your homeschool day

Explore Use pi and investigate another mathematical feature 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.