Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following program has been implemented for a newly proposed tax calculation formula for residents of a fictitious country. I/ incomeList[]: the array recording the

image text in transcribed
The following program has been implemented for a newly proposed tax calculation formula for residents of a fictitious country. I/ incomeList[]: the array recording the individual income items / childList[]: the array recording the ages of children supported by this person // parentList[]: the array recording the ages of parents supported by this person 1 public double compute Tax(double[] incomeList, int[] parentList, int[] childl ist) \{ 2 double taxAmount =0.0; 3 double incomeAmount =0.0; // calculate the income amount 4 for (int i=0;i40000&& incomeAmount 80000& \& incomeAmount 120000 ) f 14 taxAmount =800+2800+4800+ incomeAmount 0.17 131 H/ calculate the tax exemption from having children 16 int taxExemption =0; 17 int numOfChild = child List. length; 18 while (numOfChild >0 ) \{ 19 if (childList[numOfChild - 1] 60 ) I 27 taxAmount =tax Amount 2000; 28 taxExemption = taxExemption +2000;29 b 301 I/ the maximum tax exemption is 8000 each person 31 if (taxExemption 0 ) \& 33 return tax Amount; 34 \} else {// i.e., tax.Amount 8000 38 taxAmount = taxAmount +( tax Exemption 8000); 39 return Iax Amount; 401 41) Your Tasks 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

3rd Edition

0128012757, 978-0128012758

More Books

Students also viewed these Databases questions