search

# IT210 - Week 3 Sequential and Selection Processing Control Structure Appendix G

Homework

### Rating

Showing Page:
1/5
Axia College Material
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.
1
0.00-1,499.99 0.00 15 %
2.
2
1,500.00-2,999.99 225.00 16 %
3.
3
3,000.00-4,999.99 465.00 18 %
4.
4
5,000.00-7,999.99 825.00 20 %
5.
5
8,000.00-14,999.99 1425.00 25 %
Main Module
Declare name as string
Declare SalaryAmnt as real
Declare Base as real
Declare Excess as real
Declare Salary as real
Declare ReRun as string
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, “Insert Employee first name”
Input FirstName
Write, “Insert Employee last name”
Input LastName
Write, “What is the employee salary amount?”
Input SalaryAmnt
IT 210

Call Range Module
End Input Data Module
Range Module
If SalaryAmnt < 1,499.99
Then Call Salary1 Module
Else
If SalaryAmnt < 2,999.99 AND SalaryAmnt > 1,500.00
Then Call Salary2 Module
Else
If SalaryAmnt < 4,999.99 AND SalaryAmnt > 3,000.00
Then Call Salary3 Module
Else
If SalaryAmnt < 7,999.99 AND SalaryAmnt > 5,000.00
Then Call Salary4 Module
Else
If SalaryAmnt < 14,999.99 AND SalaryAmnt > 8,000.00
Then Call Salary5 Module
Else
Write,” The salary you have entered is way too big. “
Write,” Please enter a salary between 0.00 and 14,999.99.”
Call Input Module
End Range Module
Salary 1 Module
Declare Excess as real
Declare Salary as Real
Set Excess = SalaryAmnt * .015
Set Salary = SalaryAmnt - Excess
Call Output Module
IT 210

End Salary 1 Module
Salary 2 Module
Declare Base as real
Declare Excess as real
Declare Salary as real
Set Base = SalaryAmnt - 225
Set Excess = Base * .16
Set Salary = Base - Excess
Call Output Module
End Salary 2 Module
Salary 3 Module
Declare Base as real
Declare Excess as real
Declare Salary as real
Set Base = SalaryAmnt - 465
Set Excess = Base * .18
Set Salary = Base - Excess
Call Output Module
End Salary 3 Module
Salary 4 Module
Declare Base as real
Declare Excess as real
Declare Salary as real
Set Base = SalaryAmnt - 825
Set Excess = Base * .20
Set Salary = Base - Excess
Call Output Module
End Salary 4 Module
IT 210