← VCE Software Development U3O1

Refining a prompt after reviewing the output

A new prompt sent after reviewing AI code that names the exact problem, e.g. 'Use snake_case names and add range checking', so the next version fixes it.

Understanding Refining a prompt after reviewing the output in VCE Software Development U3O1

What it does: The follow-up names the problem (missing comments) and says exactly where the comments should go. After comparing both versions, the follow-up says which parts to keep from each, so the next version combines the best of both. Naming the missing validation (range checking) and the limits gives the AI a clear target. 'Better' is too vague. A follow-up prompt is based on your review of the output. You must read and check the code first to know what to name. Naming the exact convention (snake_case) tells the AI precisely what to change in the next version.

Common mistakes: The follow-up prompt asked for snake_case names and the code uses snake_case. The comment should say 'use snake_case names', not camelCase. No number is both below 0 and above 120, so the loop never runs and the range check does nothing. It should use 'or' to catch invalid ages.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 178–193) and word search (Modules 168–193).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
The AI's code uses names like MyScore and x. Which follow-up prompt is better?
Rename the variables using snake_case, such as player_score.This code is bad. Try again.
Matches
Prompt: Fix it, it is wrong
↓
Too vague: it does not name the problem, so the AI has to guess what to change. Say what is wrong, e.g. 'Add range checking to the age input'.
Applying
Meanings
Term
follow-up prompt
Meaning
A new prompt sent after reviewing AI code that names the exact problem, e.g. 'Use snake_case names and add range checking', so the next version fixes it.
Practice
Use snake_case names and add range checking
Testing
Gaps
prompt = "Use for all variables"
Check Answer
Spots
1# Follow-up: use camelCase names
2total_marks = 0

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Firefly' badge — Night Coder, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. The AI's code uses names like MyScore and x. Which follow-up prompt is better?
A. Rename the variables using snake_case, such as player_score. ✓
B. This code is bad. Try again.
A good follow-up prompt names the exact problem (naming convention) and says what you want, so the next version fixes it.
2. The generated program accepts an age of -5. What should your follow-up prompt do?
A. Ask the AI to make the program better.
B. Ask for range checking so age must be between 0 and 120. ✓
Naming the missing validation (range checking) and the limits gives the AI a clear target. 'Better' is too vague.
3. You review AI code and find it has no comments. Which follow-up prompt is best?
A. Add a comment above each function explaining its purpose. ✓
B. Fix the code.
Asking for comments, and saying where and what they should explain, is a specific follow-up prompt. 'Fix the code' does not say what is wrong.
4. True or false: after you spot a problem in generated code, a follow-up prompt should name that problem.
A. False
B. True ✓
Naming the exact problem (e.g. 'no range checking' or 'names are not snake_case') helps the next version fix it.
5. The AI gives two different versions of your code. What is the best next step?
A. Compare both versions against your requirements, then refine your prompt. ✓
B. Use the shorter one without testing it.
Comparing versions against requirements (naming, validation, comments, correctness) shows which is better and what to ask for next.

Match the Pairs

Use snake_case names for all variables → A follow-up prompt that asks the AI to apply a naming convention to the generated code
Add range checking so age must be 0 to 120 → A follow-up prompt that asks the AI to add validation with clear limits
After reviewing output that has no comments, refine the prompt to ask for explanations of the code → Add a comment above each function explaining what it does
Comparing two generated versions, then refining the prompt to keep the better features of both → Keep version B's validation but use version A's variable names
Prompt: Fix it, it is wrong → Too vague: it does not name the problem, so the AI has to guess what to change. Say what is wrong, e.g. 'Add range checking to the age input'.
Prompt: Make the code better and nicer → No specific request for names, validation or comments. Replace with 'Use camelCase names and add comments to each loop'.

Key Term

follow-up prompt
A new prompt sent after reviewing AI code that names the exact problem, e.g. 'Use snake_case names and add range checking', so the next version fixes it.

Fill in the Blanks

1. prompt = "Use snake_case for all variables"
Hint: Type the naming convention that joins lowercase words with underscores.
2. followup = "Add range checking to age"
Hint: Type the kind of validation check that tests a value sits between a minimum and a maximum.
3. followup = "Add a comment above each loop"
Hint: Type the word for the explanatory note you want added to the code.
4. if scoreB > scoreA: best = "B"
Hint: Type the comparison operator that checks version B scored higher than version A.
5. problem = "age accepts negative numbers" followUp = "Fix this: " + problem
Hint: Type the operator that joins the text to the variable naming the exact problem.

Spot the Error

Question 1
A # Follow-up: use camelCase names
B total_marks = 0
C for mark_value in marks_list:
D total_marks += mark_value
Line A — The follow-up prompt asked for snake_case names and the code uses snake_case. The comment should say 'use snake_case names', not camelCase.
Question 2
A age = int(input('Age: '))
B # Follow-up: add range checking
C while age < 0 and age > 120:
D age = int(input('Age: '))
Line C — No number is both below 0 and above 120, so the loop never runs and the range check does nothing. It should use 'or' to catch invalid ages.
Question 3
A total = sum(marks)
B # Find the highest mark
C average = total / len(marks)
D print(average)
Line B — When you ask the AI for comments, they must match what the code does. This code works out the average, so the comment should say 'Find the average mark'.
Question 4
A # v2: adds range checking
B def check_mark(mark):
C if mark < 0 or mark > 100:
D return True
E return True
Line D — Version 2 was refined to add range checking, so an out-of-range mark must return False. Returning True accepts invalid marks, so the check has no effect.
Question 5
A # Follow-up: use snake_case
B def calc_total(price, qty):
C total_cost = price * qty
D return totalCost
Line D — The variable was created as total_cost. totalCost is a different name that does not exist, so it causes a NameError and also breaks the snake_case convention. It should be 'return total_cost'.

Student with a class code? Join your class →