Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QA questions a. Select minimum number of test cases to achieve 100% statement coverage in ReturnAverage() b. Select minimum number of paths to achieve 100%

QA questions

a. Select minimum number of test cases to achieve 100% statement coverage in ReturnAverage()

b. Select minimum number of paths to achieve 100% branch coverage in ReturnAverage()

/* Function: ReturnAverage computes the average of all those numbers in the input array in the positive range [MIN, MAX]. The maximum size of the array is AS. But, the array size could be smaller than AS in which case the end of input is represented by -999. */

public static double ReturnAverage(int value[], int AS, int MIN, int MAX){

int i, ti, tv, sum;

double av;

i = 0; ti = 0; tv = 0; sum = 0;

while (ti < AS && value[i] != -999) {

ti++;

if (value[i] >= MIN && value[i] <= MAX) {

tv++;

sum = sum + value[i];

}

i++;

}

if (tv > 0)

av = (double)sum/tv;

else

av = (double) -999;

return (av);

}

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

Database Processing

Authors: David J. Auer David M. Kroenke

13th Edition

B01366W6DS, 978-0133058352

More Books

Students also viewed these Databases questions

Question

b. Did you suppress any of your anger? Explain.

Answered: 1 week ago