Week 3 Check Point
Total Tax Calculation Program
Analysis:
Process:
1. input salary amount 2. subtract minimum amount in range from salary amount to find excess 3. multiply excess by required percentage for that range 4. add excess amount to base tax 5. display total tax 6. prompt to continue or exit program
Input:
Salrange (float: 0-14999.99)
Response (float: X or Y)
Output:
Totaltax (float)
My Requirements Analysis:
1. Input salary amount
2. Hold 5 salary ranges
3. perform calculation to find total tax on specified salary amount
4. output total tax on specified salary amount
5. option to continue program for another calculation or exit program
6. 5 test conditions
7. declaration variables as float: salrange (input variable) , basetax, excess, totaltax(output variable)
8. declaration variable as string: response(input variabl)
Flowchart for a sequence of IF – Then Statements enter enter
exit exit Continue(Y) or exit (X)?
Continue(Y) or exit (X)?
Execute Then clause
Execute Then clause
Execute Then clause
Execute Then clause
Execute Then clause
Execute Then clause
Execute Then clause
Execute Then clause
Execute Then clause
Execute Then clause
Is value between range 1500-2999.99?
Is value between range 1500-2999.99?
Is value between range 3000-4999.99?
Is value between range 3000-4999.99?
Is value between range 5000-7999.99?
Is value between range 5000-7999.99?
Is value between range 8000- 14999.99?
Is value between range 8000- 14999.99?
Is value between range 0-1499.99?
Is value between range 0-1499.99?
Main Module Declare salrange as float Declare basetax as float Declare excess as float Declare totaltax as float Declare response as string Write " Welcome to the Total Tax Calculation Program " Call Calculations Module Write " Thank you, please type 'X' to exit or 'Y' to enter another salary amount " Input response If response = Y Then call