Sequential and Selection Process Control Structure

Only available on StudyMode
  • Download(s) : 303
  • Published : September 16, 2012
Open Document
Text Preview
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 |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 % | | | | | |

|Input |Processes |Output | |First Name |1. Get User Input |First Name | |Last Name | |Last Name | |Salary | |Salary | |Salary |2. Determine Range Category |Salary Range | |Salary Range Category |3. Determine Base Tax and Percentage of |Percentage Excess Total | |Percentage of Excess |Excess |Base Tax | |Base Tax | | | |Salary |4. Determine Gross Salary |Gross Salary | |Percentage Excess Total | | | |Base Tax | | | |First Name |5. Display Gross Salary |First Name | |Last Name | |Last Name | |Salary | |Salary | |Gross Salary | |Gross Salary |

Main Module
Declare Name as string
Declare SalaryAmt 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’s First Name”
Input FirstName

Write, “Insert Employee’s Last Name”
Input LastName

Write, “What is the employee’s salary?”
Input SalaryAmt

Call Range Module

End Input Data Module

Range Module

If SalaryAmt < 1,499.99
Then Call Salary1 Module

Else

If SalaryAmt
tracking img