Appendix G
Sequential and Selection Process Control Structure
In the following example, the second line of the table specifies that tax due on a salary of $2000.00 is $225.00 plus 16% of excess salary over $1500.00 (that is, 16% of $500.00). Therefore, the total tax is $225.00 + $80.00, or $305.00.
| |Salary Range in Dollars |Base Tax in Dollars |Percentage of Excess |
|1 |0.00-1,499.99 |0.00 |15 % |
|2 |1,500.00-2,999.99 |225.00 |16 % |
|3 |3,000.00-4,999.99 |465.00 |18 % |
|4 |5,000.00-7,999.99 |825.00 |20 % |
|5 |8,000.00-14,999.99 |1425.00 |25 % |
Main Module
Declare Associate_Name as string
Declare Salary_Amount as real
Declare Base as real
Declare Excess as real
Declare Salary as real
Declare Start_Over as string
REM these are the calls for the modules that can be ran. Not all modules will run
REM because associates will only fall into 1 tax bracket
Call Input Data Module
Call Range Module
Call Salary1 Module
Call Salary2 Module
Call Salary3 Module
Call Salary4 Module
Call Salary5 Module
Call Output Module
End Main Module
Input Data Module
Write, “Please Enter Associate’s Full Name”
Input Associate_Name
Write, “Associates Salary Amount?”
Input Salary_Amount
Call Range Module
End Input Data Module
Range Module
REM these statements (if, then, else) will determine what module to call upon.
If Salary_Amount < 1,499.99
Then Call Salary1 Module