Question: Please need help with question 2. Please follow the assignment instructions. Displaying the results in a table would be helpful. Thank you. You are required

 Please need help with question 2. Please follow the assignment instructions.

Displaying the results in a table would be helpful. Thank you. You

Please need help with question 2. Please follow the assignment instructions. Displaying the results in a table would be helpful. Thank you.

You are required to complete the tasks described below. Test program The following program has been implemented for a newly proposed tax calculation formula for residents of a fictitious country. // incomelist[]: the array recording the individual income items // childtist[]: the array recording the ages of children supported by this person // parentiist[]: the array recording the ages of parents supported by this person 1 public double computeTax (double[] incomeList, int [] parentlist, int[] childList) \{ double taxAmount =0.0; double incomeAmount =0.0; I/ calculate the income amount for (int i=0;i40000&& incomeAmount 80000&& incomeAmount 120000) \& taxAmount =800+2800+4800+ incomeAmount 0.17; b I/ calculate the tax exemption from having children 16 int taxExemption =0; int numOfChild = childList.length: while (numofChild >0 ) \{ if (childIist[numofChild - 1] = taxAmount 4000; taxExemption = taxExemption +4000;22 \} numofChild--; \} calculate the tax exemption from having parents for (int j=0;j60) 1 taxAmount = taxAmount 2000; taxExemption = taxExemption +2000;29 b l the maximum tax exemption is 8000 each person if (taxExemption =0 ) \{ return taxAmount; ) else 1// i.e., taxAmount 8000 taxAmount = taxAmount + (taxExemption - 8000); return taxAmount; 1 Your Tasks (1) Draw the control flow graph for this program. (2) Design test cases to achieve the 100% statement coverage on the function "computeTax" (list the statements covered by each test case using the line number of each statement). If 100% statement coverage is not feasible, explain the reason. Use the minimum number of test cases to achieve the 100% statement coverage. (3) Design test cases to achieve 100% branch coverage on the function "computeTax" (list the branches covered by each test case). If 100% branch coverage is not feasible, explain the reason. Use the minimum number of test cases to achieve 100% branch coverage. (4) Design test cases to achieve loop coverage on the function "computeTax" (list the loops covered by each test case). If it is not feasible, explain the reason. Try your best to use the minimum number of test cases to achieve the loop coverage. Consider a loop covered if at least in one test the loop body was executed 0 times, in a second test the body was executed exactly once, and in another test the body was executed more than once. Special Instructions Test cases should be presented in a table with each row showing the following: Test ID \#, input data, statements/branches/loops covered by the test case, expected output and \% coverag You may add additional columns to display key variables such as tax exemption. Code coverage should be shown by listing the statements (using line numbers) for each test case. What to Submit Combine all of your graphs and tables into a SINGLE Word or PDF Document; You may also submit a single Excel file with a separate sheet for each problem. Clearly label each section of your submission Assessment Rubric Control flow graph - 10 points Statement coverage - 25 points Branch coverage - 30 points Loop coverage - 20 points Explanations and quality of presentation - 15 points

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!