Answered step by step
Verified Expert Solution
Question
1 Approved Answer
For this portion, create a control flow chart diagram; identify each path with a letter, similar to figure 3 . 2 in the textbook. Design
For this portion, create a control flow chart diagram; identify each path with a letter, similar to figure in the textbook. Design test cases to achieve path coverage on the function computeTax Identify paths covered by each test case using your notation in the diagram. If path coverage is not feasible, explain the reason. Use the minimum number of test cases to achieve the path coverage. Can you please make the flowchart similar to the image i have attached.
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
public double computeTaxdouble incomeList, int parentList, int childList
double taxAmount ;
double incomeAmount ;
calculate the income amount
for int i ; i incomeList.length; i
incomeAmount incomeAmount incomeListi;
calculate the basic tax
if incomeAmount
taxAmount incomeAmount ;
else if incomeAmount && incomeAmount
taxAmount incomeAmount ;
else if incomeAmount && incomeAmount
taxAmount incomeAmount ;
else if incomeAmount
taxAmount incomeAmount ;
calculate the tax exemption from having children
int taxExemption ;
int numOfChild childList.length;
while numOfChild
if childListnumOfChild
taxAmount taxAmount ;
taxExemption taxExemption ;
numOfChild;
calculate the tax exemption from having parents
for int j ; j parentList.length; j
if parentListj
taxAmount taxAmount ;
taxExemption taxExemption ;
the maximum tax exemption is each if taxExemption
if taxAmount
return taxAmount;
else ie taxAmount
return ;
else ie taxExemption
taxAmount taxAmount taxExemption ;
return taxAmount;
also the code has lines. It starts with line at the public double part. the random numbers you see are telling you what line of code it is
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started