Task 7 Practical Guide

Data And Variables

Choose suitable variable names and data types for a short practical task.

Steps

  1. 1 List each value used by the program.
  2. 2 Choose a variable name that explains the value.
  3. 3 Choose a suitable data type.
  4. 4 Check whether the value changes during the program.
  5. 5 Use the same variable names in your pseudocode and code where possible.

Examples

Integer

`balancedCount` stores a whole-number count.

Boolean

`isBalanced` stores true or false after a condition is checked.

Text/string

`studentName` stores the user name in the approved programming environment.

Avoid

Using one-letter names for scenario values

Changing variable names halfway through

Using a variable without assigning a value first

Task 7 Syllabus Reminder

Integer, real, Boolean and character data types.
Meaningful variable naming conventions.
Source code and executable code.
Sequence, one-way selection, two-way selection, multi-way selection, test-first iteration, test-last iteration and fixed iteration.
Syntax, run-time and logical errors.
Data validation, test data and trace tables.
Flow charts and pseudocode used to model and test algorithm logic.
Internal and external documentation where relevant.