Blog

Coursehelp
March 15, 2019
QUESTION : No Comments

(Solved) : Program P1 1 Integer B 2 Input 3 0 4 5 2 6 20 30 7 8 B 2 10 11 Else 12 13 B 2 15 16 Output Q17864242

Program P1 :

1) integer A, B;

2) input (A);

3) while (A > 0)

4) {

5) A = 2 * A;

6) if (A < 20 or A > 30)

7) {

8) B = A * 2;

10) }

11) else

12) {

13) B = A + 2;

15) }

16) output (A, B);

17) input (A);

18) }

19) end;

T = {t1=<4>, t2=<25>, t3=<-1>}
or T = {t1=, t2=, t3=}

What is the statement domain for P1? Express as line numbers.Exclude syntactical markers, such as {, }, else, and end.

What is the statement coverage of T for P1? Express as afraction.

If the statement coverage of T for P1 is less than 100%, whattest cases do you need to add to get 100% statement coverage?

What is the decision domain for P1? Express as “line number)decision”.

What is the decision coverage of T for P1? Express as afraction.

If the decision coverage of T for P1 is less than 100%, whattest cases do you need to add to get 100% decision coverage?

What is the condition domain for P1? Express as “line number)condition”.

What is the condition coverage of T for P1? Express as afraction.

If the condition coverage of T for P1 is less than 100%, whattest cases do you need to add to get 100% condition coverage?

Expert Answer


Attached . . .

OR
OR

Have a Comment on this Question?

Questions viewed by other students


  • QUESTION : (Solved) : 13 Complete Following Method 12 Points Public Void Printoceanbymaxdepth Stringtl Oceanname Q29452825

    13) Complete the following method (12 points): public void printoceanByMaxDepth(stringtl oceanNames, int [ ] maxDepthsMe ters) { … } Assume names and maximum depths of all oceans are unique, and maxDepthsMeters [ contains the maximum depth of oceanNames[i for any i. Your method should first use an assertion to make sure the two input arrays have the same length. Then print one line for each ocean in oceanNames, like the following: Maximum depth of Indian Ocean is 8047 meters. The output should be in ascending order by depth. ZERO POINTS FOR ANY SOLUTION THAT RUNS IN O(n2) TIME OR WORSE.

    13) Complete the following method (12 points): public void printoceanByMaxDepth(stringtl oceanNames, int [ ] maxDepthsMe ters) { … } Assume names and maximum depths of all oceans are unique, and maxDepthsMeters [ contains the maximum depth of oceanNames[i for any i. Your method should first use an assertion to make sure the two input arrays have the same length. Then print one line for each ocean in oceanNames, like the following: Maximum depth of Indian Ocean is 8047 meters. The output should be in ascending order by depth. ZERO POINTS FOR ANY SOLUTION THAT RUNS IN O(n2) TIME OR WORSE. Show transcribed image text

    Expert Answer


    Attached . . .


    view full answer
  • QUESTION : (Solved) : 13 Consider Following Matrices 11 2 3 4 0 4 11 95 B 0 C 351 D 5 52 0 E 1 3 5 7 6 8 0 9 4 2 Q29934877

    1.3. Consider the following matrices: A = (11 -2 3 4 0 4 ); 11 95/ B = 0); c= (351% ); D= (5 52 %): 0 E = (1 3 5 7 6 8 0 9 4 2) Write MATLAB commands to determine or execute the following: a) To compute the matrix multiplication of Z=CD. @ b) To arrange the element of the vector E in ascending order. @ c) To return the smallest element of vector A. @ d) To delete the 2nd column from matrix C. @ e) To solve for X= A-1 B. @ PFE610S Page 2 2 Opp E3/06/2018

    1.3. Consider the following matrices: A = (11 -2 3 4 0 4 ); 11 95/ B = 0); c= (351% ); D= (5 52 %): 0 E = (1 3 5 7 6 8 0 9 4 2) Write MATLAB commands to determine or execute the following: a) To compute the matrix multiplication of Z=CD. @ b) To arrange the element of the vector E in ascending order. @ c) To return the smallest element of vector A. @ d) To delete the 2nd column from matrix C. @ e) To solve for X= A-1 B. @ PFE610S Page 2 2 Opp E3/06/2018 Show transcribed image text 1.3. Consider the following matrices: A = (11 -2 3 4 0 4 ); 11 95/ B = 0); c= (351% ); D= (5 52 %): 0 E = (1 3 5 7 6 8 0 9 4 2) Write MATLAB commands to determine or execute the following: a) To compute the matrix multiplication of Z=CD. @ b) To arrange the element of the vector E in ascending order. @ c) To return the smallest element of vector A. @ d) To delete the 2nd column from matrix C. @ e) To solve for X= A-1 B. @ PFE610S Page 2 2 Opp E3/06/2018

    Expert Answer


    Attached . . .


    view full answer