Submitted by: Submitted by Sivart
Views: 160
Words: 462
Pages: 2
Category: Science and Technology
Date Submitted: 03/09/2014 01:13 PM
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 $2,000.00 is $225.00 plus 16% of excess salary over $1,500.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 %
Analysis
Process:
1. Display a program title.
2. Prompt for Salary.
3. Prompt for Base Salary in range.
4. Prompt for the Base Tax amount.
5. Prompt for the Percentage of Excess listed in range. (will need to convert to decimal in calculation)
6. Calculate the Percentage of Excess tax amount by subtracting the salary amount then multiplying the result by the Percentage of Excess.
7. Calculate total tax by adding the Base Tax Amount to the value from step 6.
8. Display the Salary, the Percent of Excess tax amount, the Base Tax Amount and the total tax amount.
9. Display the price per ounce and total purchased cost.
Input:
Salary (float: Salary)
Base Salary (float: BaseSalary)
Base Tax Amount (float: BaseTax)
Percent of Excess (float: PercentExcess)
Output:
Excess Tax Amount (float: ExcessTax)
Total Tax (float: TotalTax)
Design
Main Module
Declare Salary As Float
Declare BaseSalary As Float
Declare BaseTax As Float
Declare PercentExcess As Float
Write “Salary Tax Calculation Program”
Write “”
Write “By Travis Quesenberry”
Call Input_Data module
Call Calculation_Data module
Call Output_Results module
End Program
Input_Data Module
Write “Enter the Salary:”
Input Salary
Write “Enter the base salary (lowest) in the range:”
Input BaseSalary
Write “Enter the Base Tax for the range:”
Input BaseTax
Write “Enter the Percentage of Excess for the range:”
Input...