- The elements of the module are related only by the control flow or ”logic”
- Occurs when several operations are placed within one function and the control flow decides which operation to use - they are all within a big
if-else
orswitch
statement - Resolution is by modularisation
Example
function getInput(choiceFlag) {
switch choiceFlag {
case FILE_INPUT:
// file input logic
break;
case TERMINAL_INPUT:
// terminal input logic
break;
case USER_INPUT:
// user input logic
break;
}
}