How to design and code a simple, effective user interface — starting text-based, but grounded in principles that apply to any interface.
Creating a simple text-based user interface means clearly prompting the user for input and providing meaningful error messages when input fails validation.
Principles of good user interface design (from a visual perspective, building on 10.2.5):
| Principle | Meaning |
|---|---|
| Structure | The interface should be organised in a way that makes logical sense to the user |
| Simplicity | The interface shouldn't be cluttered; tasks should be easy to accomplish |
| Visibility | All the options a user needs should be available, without extra, distracting, irrelevant information |
| Feedback | Keep users informed of what's happening — confirmations, current state, relevant errors |
| Tolerance | The design should be flexible and forgiving — users will make mistakes, so the design should prevent invalid input where possible rather than just rejecting it after the fact |
| Reuse | Reuse familiar behaviours/components consistently, so users don't need to relearn how things work in different parts of the interface |
Comparing Desktop UI to Mobile Application UI:
| Aspect | Desktop UI | Mobile UI |
|---|---|---|
| Input method | Keyboard and mouse, precise pointer | Touch — needs larger tap targets |
| Screen space | Generally larger, more room for information | Smaller, requires simplified/prioritised layouts |
| Navigation | Menus, toolbars often always visible | Often collapsed (e.g. hamburger menu) to save space |
Example
A poor text-based error message: 'Error: invalid input.' A good one, matching the Tolerance principle: 'Please enter an age between 0 and 120.'
💡 Exam Tip
This subtopic explicitly notes it's for practical, coded prompts/error messages too — a 'good' error message in your Java program should tell the user exactly what went wrong and what valid input looks like, not just print 'Error'.