Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Preview

Design the product and check AI code

This is the first page of the lesson. Read it and have a go at the activities. The rest is in the full lesson.

50 minutes

Plan the house before you build it

Nobody builds a house by laying bricks and hoping. They draw plans first.

Software needs plans too. You draw the screens. You plan the steps. You plan the data.

Today you also meet a new helper: an AI tool that can write code. It is fast. But you must check every line.

Key words

WordWhat it meansExample
InterfaceThe part of the software that a user sees and touches.screens and buttons
WireframeA simple drawing of a screen, with no colour or pictures.boxes for the logo and the menu
AlgorithmA list of steps that solves a problem.how to work out the order total
FlowchartA picture of steps joined by arrows.start, add up the food, show the bill
FunctionA named block of code that does one job.delivery_fee
LicencePermission, with rules, to use something that somebody else made.free to copy, but you must say who made it
Data requirementWhat facts the software must store, and what kind each one is.name: text; price: a number
Generative AIA tool that makes new text or code from a request you type.a chat tool that writes a function
PromptThe request you type to a generative AI.Write a function for a delivery fee.
ReviewRead and check somebody else's work, or a tool's work.check the code against the list of requirements
RequirementSomething the software must do or be.Delivery is free over 20 pounds.

The cells students fill in are left blank in this preview.

Quick check: design words

Have a go

Quick check: design words

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

Three things to design

DesignWhat you makePizza app example
InterfaceWireframes of each screenThe order screen: pizza list, size buttons, total, Pay button
AlgorithmsFlowcharts or step listsSteps to add up the basket and the delivery fee
DataA table of the facts to storeCustomer name, phone number, pizza, size, price

The cells students fill in are left blank in this preview.

Data requirements for an order

FieldKind of dataRule
customer_nameTextCannot be empty
phoneTextText, because we never add phone numbers
quantityWhole number1 to 10
priceNumber with decimalsNever below 0
paidTrue or FalseFalse until payment works

The cells students fill in are left blank in this preview.

Using AI to write code

A generative AI can write a section of code in seconds. You type a prompt. It gives code back.

The code looks neat and correct. But it can be wrong. It does not know your requirements unless you tell it. It is your job to check the code you use.

Run the AI code: it looks fine

Code: python
def delivery_fee(food_total):
    if food_total > 20:
        return 0
    return 3

print(delivery_fee(10))
print(delivery_fee(30))
print(delivery_fee(20))

# Requirement: free delivery at 20 or more.
# Look at the last line of output. Is it right?

The lesson goes on

5 more parts of this lesson are in the full curriculum, with the tasks, the final check and the labs. A college account gives your students all of it.