← VCE Applied Computing U1O2

Hungarian notation

Starting a variable name with a short data type prefix, then a descriptive name, such as strName, intAge, fltPrice or blnPassed.

Understanding Hungarian notation in VCE Applied Computing U1O2

What it does: It starts with the int prefix for whole numbers, then the descriptive name StudentAge in camel case. The flt prefix shows the variable is a float (decimal number) and Price describes its purpose. int is the prefix for integer (whole number) values. bln is for Boolean values. bln stands for Boolean, which holds True or False. Hungarian notation puts the short data type prefix at the start of the variable name.

Common mistakes: The value 4.50 is a decimal number, so the prefix must be flt, not int. The line should be fltPrice = 4.50. The comparison gives True or False, which is a Boolean. The prefix should be bln, so the name should be blnPassed, not strPassed.

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 8–88) and word search (Modules 8–124).

Take this worksheet further — free with Cloodit

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

Learning
Duo
Which variable name uses Hungarian notation to store a student's name as text?
strNamenameStr5
Matches
intStudentName = "Ava"
↓
The int prefix is wrong because the value is text. It should use str, as in strStudentName.
Applying
Meanings
Term
Hungarian notation
Meaning
Starting a variable name with a short data type prefix, then a descriptive name, such as strName, intAge, fltPrice or blnPassed.
Practice
strFirstName = "Mia"
Testing
Gaps
Name = "Ava"
Check Answer
Spots
2intAge = 16
3intPrice = 4.50

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

The 'Dolphin' badge — Reef Streak, 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. Which variable name uses Hungarian notation to store a student's name as text?
A. strName ✓
B. nameStr5
The prefix str (string) comes first, then a descriptive name: strName.
2. Which prefix would you use for a variable that holds a whole number such as an age?
A. blnAge
B. intAge ✓
int is the prefix for integer (whole number) values. bln is for Boolean values.
3. Which name best suits a variable holding the price of an item, such as 4.50?
A. fltPrice ✓
B. strPrice
A price with decimals is a float, so flt is the correct prefix. str would suggest text.
4. Which name best suits a variable that stores True or False for whether a student passed?
A. intPassed
B. blnPassed ✓
bln stands for Boolean, which holds True or False.
5. Where does the data type prefix go in Hungarian notation?
A. At the start of the name, like intScore ✓
B. At the end of the name, like scoreInt
Hungarian notation puts the short data type prefix at the start of the variable name.

Match the Pairs

strFirstName → A string variable, shown by the str prefix before the descriptive name FirstName
blnPassed → A Boolean variable holding True or False, shown by the bln prefix
An integer variable for a student's age using Hungarian notation and camel casing → intStudentAge
A float variable holding a decimal price, with the data type prefix first → fltPrice
intStudentName = "Ava" → The int prefix is wrong because the value is text. It should use str, as in strStudentName.
age = 16 → The name has no data type prefix. Hungarian notation needs one, such as intAge.

Key Term

Hungarian notation
Starting a variable name with a short data type prefix, then a descriptive name, such as strName, intAge, fltPrice or blnPassed.

Fill in the Blanks

1. strName = "Ava"
Hint: Type the Hungarian notation prefix used for a variable that stores text.
2. intAge = 16
Hint: Type the prefix used for a variable that stores a whole number.
3. fltPrice = 4.5
Hint: Type the prefix used for a variable that stores a decimal number.
4. blnIsMember = False
Hint: Type the prefix used for a variable that stores True or False.
5. blnPassed = True if blnPassed: print("Well done")
Hint: Type the variable name declared on the first line, including its type prefix and camel case name.

Spot the Error

Question 1
A strName = "Mia"
B intAge = 16
C intPrice = 4.50
D print(strName, fltPrice)
Line C — The value 4.50 is a decimal number, so the prefix must be flt, not int. The line should be fltPrice = 4.50.
Question 2
A intScore = 18
B intTotal = 20
C strPassed = intScore >= 10
D print(blnPassed)
Line C — The comparison gives True or False, which is a Boolean. The prefix should be bln, so the name should be blnPassed, not strPassed.
Question 3
A strFirst = "Ali"
B strlast = "Khan"
C strFull = strFirst + strLast
Line B — After the prefix, the descriptive name must start with a capital letter (camel casing). It should be strLast. The other lines also refer to strLast.
Question 4
A fltPrice = 12.50
B qtyInt = 3
C fltTotal = fltPrice * intQty
D print(fltTotal)
Line B — In Hungarian notation the data type prefix goes at the START of the name, not the end. It should be intQty.
Question 5
A strName = "Zoe"
B intMark = 62
C fltAvg = 62.5
D boolPassed = intMark >= 50
Line D — The agreed prefix for a Boolean variable is bln, not bool. The line should be blnPassed = intMark >= 50.

Student with a class code? Join your class →