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. If 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. If incomeList[]: the array recording the individual income items I/ childList[]: the array reconding the ages of children supported by this person I/ parentList[]: the array recording the ages of parents supported by this person I public double compute Tax(double[] incomeList, int[] parentL ist, int[] childL ist) \& 2 double tax Amount =0,0; 3 double incomeAmount =0.0; If calculate the income amount 4 for (int i=0;i40000k& incomeAmount 80000&& incomeAmount 120000 ) i 14 taxAmount 800+2800+4800+ incomeAmount * 0.17; 151 // calculate the tax exemption from having children 16 int taxExemption =0; 17 int numOfChild = childL ist.length: 18 while (numOfChild >0 ) f 19 if (childList[numOfChild 1]60 ) i 27 taxAmount = tax.Amount - 2000: 28 taxExemption = taxFxemption +2000;29 30 ? I/ the maximum tax exemption is 8000 each person 31 if (taxExemption x=8000 ) 32 if (tax Amount >=0 ) i 33 retum taxAmount; 34 ) else f // i.e., tax.Amount 8000 38 taxAmount =taxA mount + (taxExemption 8000); 39 retum taxAmount; 40} 41? Your Tasks Design test cases to achieve the 100% statement coverage on the function "compute Tax " (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

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

Step: 3

blur-text-image

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

1st Edition

1597496251, 978-1597496254

More Books

Students also viewed these Databases questions

Question

1. What is a multinational corporation?

Answered: 1 week ago