Writing an IPO chart for a program

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Writing an IPO chart for a program

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A program asks for a student's name and two test marks, then shows their average. Which entry belongs in the Input column of the IPO chart?
A Average of the two marks
B Name, mark 1 and mark 2 entered by the user
2. In an IPO chart for a program that converts Celsius to Fahrenheit, where does 'multiply by 9/5 and add 32' go?
A Process column
B Output column
3. A program uses print() to show 'Total cost: $45.00'. Which IPO column lists this?
A Output
B Input
4. Which Process entry is written correctly for a program that decides if a student passes?
A If mark >= 50 then result is Pass, else result is Fail
B Ask the user to enter their mark
5. A requirement says: 'The program must display the total price including 10% GST.' Which IPO row matches this requirement?
A Input: total price | Process: none | Output: price
B Input: price | Process: price * 1.1 | Output: total price

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1name <- input("Enter name: ") AAsking for a value is an input, not an output. It should be in the Input column, and Output should only list results or messages displayed.
2print("Total: ", total) BA calculation has been placed in the Input column. It should be in the Process column, because Input only lists values the user enters.
3A Process row lists a calculation the program makes with the inputs Ctotal <- price * quantity
4A Process row can also record a decision the program makes DAn Output row in an IPO chart: the program displays a message and the result to the user
5Input column: total <- price * quantity Eif mark >= 50 then result <- "Pass"
6Output column: ask the user for their age FAn Input row in an IPO chart: the program asks the user to enter a name and stores it in a variable

Definitions

IPO chart

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
age = _____("Enter your age: ")
2.
price = float(input("Price: ")) qty = int(input("Qty: ")) total = price * ___
3.
total = price * qty print("Total cost: ", _____)
4.
mark = int(input("Mark: ")) if mark __ 50: print("Pass")
5.
name = input("Name: ") _____("Hello, " + name)

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A Requirement: show weekly pay
B Input: hours = input()
C Process: pay <- hours * 15
D Output: print(hours)
Question 2
A Input: age = input()
B Process: adult <- age <= 18
C Output: print(adult)
Question 3
A Input: c = input()
B Process: f <- c * 5 / 9 + 32
C Output: print(f)
Question 4
A Input: w, h, area
B Process: area <- w * h
C Output: print(area)
Question 5
A Input: mark = input()
B Process: pass <- mark >= 50
C Output: print(passed)

Answer Key

Writing an IPO chart for a program
Section A: Quick Questions
Q1
B — Name, mark 1 and mark 2 entered by the user
Q2
A — Process column
Q3
A — Output
Q4
A — If mark >= 50 then result is Pass, else result is Fail
Q5
B — Input: price | Process: price * 1.1 | Output: total price
Section B: Match the Pairs
Q1
name <- input("Enter name: ") → An Input row in an IPO chart: the program asks the user to enter a name and stores it in a variable
Q2
print("Total: ", total) → An Output row in an IPO chart: the program displays a message and the result to the user
Q3
A Process row lists a calculation the program makes with the inputs → total <- price * quantity
Q4
A Process row can also record a decision the program makes → if mark >= 50 then result <- "Pass"
Q5
Input column: total <- price * quantity → A calculation has been placed in the Input column. It should be in the Process column, because Input only lists values the user enters.
Q6
Output column: ask the user for their age → Asking for a value is an input, not an output. It should be in the Input column, and Output should only list results or messages displayed.
Section C: Definitions
Q1
IPO chart — A table with Input, Process and Output columns that lists what the user enters, the calculations and decisions the code makes, and the results or messages it displays.
Section D: Fill in the Blanks
Q1
age = input("Enter your age: ")
Q2
price = float(input("Price: ")) qty = int(input("Qty: ")) total = price * qty
Q3
total = price * qty print("Total cost: ", total)
Q4
mark = int(input("Mark: ")) if mark >= 50: print("Pass")
Q5
name = input("Name: ") print("Hello, " + name)
Section E: Spot the Error
Q1
D — The requirement is to show the weekly pay, so the Output row must print pay (the result of the process), not the hours the user entered. It should be print(pay).
Q2
B — An adult is someone aged 18 or over, so the decision must use >=. The broken line uses <=, which is true for people under 18.
Q3
B — The Celsius to Fahrenheit calculation multiplies by 9/5, not 5/9. The Process row must hold the correct calculation: f <- c * 9 / 5 + 32.
Q4
A — area is calculated in the Process row, so the user does not enter it. The Input row should only list the values the user enters: w, h.
Q5
C — The Output row must print a value that the Process row created. The process made pass, not passed, so it should be print(pass).