Gallery
Solution Triathlon
Share
Explore

icon picker
Solution

At the right hand side is the the task, starter code and code clips that pupils got.
Below is a link to the solution. You can right click open on replit to demo the answer to pupils and talk through the code.
solution
# INPUT DATA

# prompt for swim points, get keyboard input
swimPoints = int(input('Enter swimming points: '))
# prompt for cycling points, get keyboard input
cyclePoints = int(input('Enter cycling points: '))
# prompt for running points, get keyboard input
runPoints = int(input('Enter running points: '))

# PROCESS DATA
# set totalPoints to points for swim add cycle add run
totalPoints = swimPoints + cyclePoints + runPoints

# OUTPUT DATA
# display message with totalPoints
print('Swim, cycle, run total: ' + str(totalPoints))

complete IPO

Question marks ? are place holders for missing parts.
Encourage learners to practice working with markdown for headings , sub-headings and bullet-points.
IPO
===

Input
---
* swimming points
* cycling points
* running points

Process
---
* calculate total as swim points + cycle points + run points

Output
---
* display message with total

complete pseudocode

Question marks ? are place holders for missing parts.
Encourage learners to practice working with markdown for headings , sub-headings and bullet-points.
Design pseudocode
======

Input
-----
1. prompt for swim points
2. get swim points number input from keyboard
3. prompt for cycle points
4. get cycle points number input from keyboard
5. prompt for run points
6. get run points number input from keyboard


Process
-------
1. calculate total points as swim points + cycle points + run points


Output
------
1. display message with total points


# INPUT DATA

# prompt for swim points, get keyboard input
swimPoints = int(input('Enter swimming points: '))
# prompt for cycling points, get keyboard input
cyclePoints = int(input('Enter cycling points: '))
# prompt for ???


# PROCESS DATA
# set totalPoints to points for swim add cycle add run
totalPoints = swimPoints + cyclePoints

# OUTPUT DATA
# display message with totalPoints
print('Swim, cycle, run total: ' + str(totalPoints))


Share
 
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.