Before writing any code, developers need to understand exactly what a program is meant to achieve. This is known as the purpose of the program.
Think of it like planning a road trip—you need to know your destination before you decide how to get there. Without a clear purpose, developers might end up building something that doesn’t actually solve the problem.
Example
The following sentence describes a simple software development problem:
"A program is required which will ask the user to enter three numbers and display whichever is the greatest."
This sentence defines the program’s purpose—to compare three numbers and determine which one is the largest.
Why is Purpose Important?
Defining the purpose before coding starts ensures that:
✔ The software actually solves the problem.
✔ Developers can plan the necessary inputs, processes, and outputs.
✔ Testing and evaluation will check if the program does what it was intended to do.
A program’s purpose is often given as part of a problem statement or written as a clear goal.
Example:
"A program is required to calculate an employee’s weekly wage based on their hours worked and hourly rate."
Here, the purpose is clear—to calculate wages—which helps in designing the rest of the software.
Once the purpose of a program is defined, the next step is to identify its functional requirements.
Functional requirements describe what the program must do—focusing on inputs, processes, and outputs.
Think of a functional requirement like a recipe:
Inputs → The ingredients you need.
Processes → The steps to follow.
Outputs → The final dish you’re serving.
Example
A program should ask the user to input the radius of a circle. The program should then calculate and display the area and the circumference of the circle.
Inputs:
These are the pieces of information the user provides to the program.
Data entered via a keyboard
Sensor readings from a device
File contents loaded into the program
Processes:
The operations the program performs using the inputs.
Calculations (e.g., total cost, temperature conversion)
Sorting and searching data
Decision-making (e.g., checking if a password is correct)
Outputs:
The results that the program provides to the user.
Displaying text or numbers on a screen
Printing a document
Playing a sound
Example: A Simple Wage Calculator
A program is required to calculate an employee’s weekly wage based on hours worked and hourly rate.
Why Functional Requirements Matter
Functional requirements help developers and testers by clearly outlining:
✔ What data the program needs.
✔ What the program should do with that data.
✔ What the expected results should be.
Without defining functional requirements, the program might not work correctly or meet the user’s needs.