成人论坛

Examples of analysis

The following brief examples demonstrate the distinction between the purpose and functional requirements of software.

Example 1

Purpose

Software should be created to allow a user to enter ten numbers. Each number must be validated to make sure that it is no less than 0 and no more than 100. The program should keep a running total of the numbers entered and output the final total.

Functional requirements

InputsProcessesOutputs
Ten numbersValidate ten numbersTotal
Calculate total
InputsTen numbers
ProcessesValidate ten numbers
OutputsTotal
Inputs
ProcessesCalculate total
Outputs

Example 2

Purpose

The owners of a theme park have asked that a program be developed to record the average number of visitors in a week. A user will enter the total number of visitors for each day of the week. The program should then output the average number of visitors across the week.

Functional requirements

InputsProcessesOutputs
Daily totalCalculate averageAverage
InputsDaily total
ProcessesCalculate average
OutputsAverage

Example 3

Purpose

A program is to be developed to create usernames for a class of twenty pupils. The program will ask a teacher to enter the first name, surname and age of each pupil. The age entered must be between five and eighteen. The program should output a list of usernames for the teacher.

Functional requirements

InputsProcessesOutputs
Pupil first nameValidate ageList of usernames
Pupil surnameCreate username
Pupil age
InputsPupil first name
ProcessesValidate age
OutputsList of usernames
InputsPupil surname
ProcessesCreate username
Outputs
InputsPupil age
Processes
Outputs