Beginner level · Module 5: Console Application Project in Java · Lesson 1 of 3
From Requirements to a Plan
Read a short requirement and identify the classes, their data and methods, and the menu the user will see.
In this lesson you will
- Identify candidate classes from nouns and methods from verbs in a requirement
- Sketch a class plan and menu before coding
Key concepts
requirementresponsibilityclass planmenu flow
The lesson
Start by underlining nouns and verbs in the requirement. Nouns such as sale, item and day suggest classes or fields; verbs such as record, list and total suggest methods. Not every noun becomes a class — some are just fields.
Give each class one clear responsibility. A Sale holds one sale's data; a SalesBook stores many sales and calculates totals; the main class handles the menu and input. Keeping input and printing out of the data classes makes them easier to test.
Write the plan as a simple table or sketch: class, fields, methods. Then list the menu options and what each one calls. Ten minutes of planning saves hours of rewriting.
Step by step
- Read the Shop Sales Recorder requirement and underline nouns and verbs.
- Decide on the classes and list their fields and methods.
- Sketch the menu and which method each option calls.
- Review the plan with a partner before coding.
Practice activity
Produce a one-page plan for the level project: classes with fields and methods, the menu, and the order in which you will build it.
Expected result: A clear plan the instructor can approve, with each menu option mapped to a method.
Check your understanding
-
In a requirement, what do verbs usually suggest?
Show answer
Methods.
-
Why keep printing and input out of data classes such as Sale?
Show answer
It keeps each class focused and makes the data logic easier to test and reuse.
Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.