These two tasks could have been separated into modules, before the
algorithm was developed in pseudocode. Breaking a problem into
modules will be discussed in Chapter 7.
The solution algorithm can also be represented by a N-S diagram:
Compute-Employee-Pay
Set All-fields-valid to true
Set Error-message to blank
Read Emp-no, Pay-rate, Hrs-worked
Error-message
=
'Pay rate exceeds
£25.00'
All-fields-valid = false
Error-message
='Hours
worked exceeds limit of 60'
All-fields-valid = false
Print Emp-no
Pay-rate,
Hrs-worked,
Error-message
Emp-weekly-pay
=
Pay-rate
*
Hrs-worked;
Print Emp-no,
Pay-rate,
Hrs-worked,
Emp-weekly-pa ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.