Monday, October 28, 2019
Week 3, Checkpoint, Sequential and Selection Process Control Structure Essay Example for Free
Week 3, Checkpoint, Sequential and Selection Process Control Structure Essay Week 3, Checkpoint, Sequential and Selection Process Control Structure Payroll tax Calculation System Requirements -Salary Range 1 is 0.00 -1,499.99 -Salary Range 2 is 1,500.00-2,999.99 -Salary Range 3 is 3,000.00-4,999.99 -Salary Range 4 is 5,000.00-7,999.99 -Salary Range 5 is 8,000.00-14,999.99 -If the Salary Range is greater than 0.00, then the tax base is 0.00 plus 15% of the amount over 0.00 (amount-0.00*15%+0.00) -If the Salary Range is greater than 1,500.00, then the tax base is $225.00 plus 16% of the amount in excess of 1,500.00 (amount -1,500.00*16%+225.00) -If the Salary Range is greater than 3,000.00, then the tax base is 5. 00 plus 18% of the amount in excess of 3,000.00 (amount-3,000.00*18%+465.00) -If the Salary Range is greater than 5,000.00, then the tax base is $825.00 plus 20% of the amount in excess of 5,000.00 (amount-5,000.00*20%+825.00) -If the Salary Range is greater than 8,000.00, then the tax base is $1425.00 plus 25% of the amount in excess of 8,000.00 (amount-8,000.00*25%+1425.00) Input-Process-Output Chart Input Process Output (keyboard) Get the amount of salary earned GrossSalary (integer) Salary (integer) Calculate the total tax and adjusted net salary GrossSalary (integer) BaseTax (float) AddlTax (float) TotalTax (float) NetSalary (float) GrossSalary (integer) BaseTax (float) AddlTax (float) TotalTax (float) NetSalary (float) Display the Gross Salary, Base Tax, Additional Tax and Adjusted Net Salary (output to screen) FLOWCHARTs Main Module Calculate Net Salary Module DisplayGrossSalaryBaseTaxAdditionalTaxNetSalary Module PSEUDOCODE Main Module Declare GrossSalary as Integer Declare BaseTax as Float Declare BaseSalary as Float Declare AddlTax as Float Declare TotalTax as Float Declare NetSalary as Float Print ââ¬Å"Enter the amount of the Gross Salary earnedâ⬠Input GrossSalary Call CalculateNetSalary Module Call DisplayGrossSalaryBaseTaxAdditionalTaxNetSalary Module End Main Module CalculateNetSalary Module NetSalary = GrossSalary ââ¬â BaseTax ââ¬â (GrossSalary ââ¬â BaseSalary * AddlTax) If GrossSalary 0.00 1,500.00 Then BaseTax = 0.00 BaseSalary = 0.00 AddlTax = (Gross Salary ââ¬â BaseSalary) * 0.15 End if If GrossSalary 1,500.00 3,000.00 Then BaseTax = 225.00 BaseSalary = 1,500.00 AddlTax = (Gross Salary ââ¬â BaseSalary) * 0.16 End if If GrossSalary 3,000.00 5,000.00 Then BaseTax = 465.00 BaseSalary = 3,000.00 AddlTax = (Gross Salary ââ¬â BaseSalary) * 0.18 End if If GrossSalary 5,000.00 8,000.00 Then BaseTax = 825.00 BaseSalary = 5,000.00 AddlTax = (Gross Salary ââ¬â BaseSalary) * 0.20 End if If GrossSalary 8,000.00 15,000.00 Then BaseTax = 1,425.00 BaseSalary = 8,000.00 AddlTax = (Gross Salary ââ¬â BaseSalary) * 0.25 End if If GrossSalary 15,000.00 Then BaseTax = 1,425.00 BaseSalary = 8,000.00 AddlTax = (Gross Salary ââ¬â BaseSalary) * 0..25 End if GrossSalary ââ¬â BaseTax ââ¬â (GrossSalary ââ¬â BaseSalary * AddlTax) End CaclulateNetSalary Module DisplayGrossSalaryBaseTaxAddlTaxNetSalary Module Print ââ¬Å"Employee Gross Pay, Tax and Net Pay Breakdownâ⬠Print ââ¬Å"Gross Salaryâ⬠GrossSalary Print ââ¬Å"Base Taxâ⬠BaseTax Print ââ¬Å"Additional Taxâ⬠AddlTax Print ââ¬Å"Net Salaryâ⬠* NetSalary End DisplayGrossSalaryBaseTaxAddlTaxNetSalary Module Test Values Input Expected Output Comments Salary = 0.00 Tax = 0.00 Lowest salary in salary range 1 Salary = -1,000.00 Error Message Out of range condition Salary = 1,000.00 Tax = 150.00 Midrange salary in salary range 1 Salary= 1,499.99 Tax = 225.00 Highest salary in salary range 1 Salary = 1,500.00 Tax = 225.00 Lowest salary in salary range 2 Salary = 2,250.00 Tax = 345.00 Midrange salary in salary range 2 Salary = 2,999.99 Tax = 465.00 Highest salary in salary range 2 Salary = 3,000.00 Tax = 465.00 Lowest salary in salary range 3 Salary = 4,000.00 Tax = 645.00 Midrange salary in salary range 3 Salary = 4,999.99 Tax = 825.00 Highest salary in salary range 3 Salary = 5,000.00 Tax = 825.00 Lowest salary in salary range 4 Salary = 6,500.00 Tax = 1,095.00 Midrange salary in salary range 4 Salary = 7,999.99 Tax = 1,425.00 Highest salary in salary range 4 Salary = 8,000.00 Tax = 1,425.00 Lowest salary in salary range 5 Salary = 11,500.00 Tax = 2,300.00 Midrange salary in salary range 5 Salary = 14,999.99 Tax = 3,175.00 Highest salary in salary range 5 Salary = 15,000.00 Tax = 3,175.00 Salary that exceeds the highest salary in salary range 5 by 0.01 Salary = 100,000.00 Tax = 24,425.00 Salary that exceeds the highest salary in salary range 5
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.