Given the method implementation, do the following: int CalculateDeviation(int x, int y) { a int total=0; b if (x>30) { c
Posted: Thu Jul 14, 2022 2:13 pm
Given the method implementation, do the following:
int CalculateDeviation(int x, int y) {a int total=0;b if (x>30) {c total=(x*40+y*50)*.95; }d for (int i=0;i<y;i++) {e total+=y*5; }f return total;}
(a) Draw the flow graph corresponding to the methodCalculateDeviation. [4 marks]
(b) Describe the minimum set of paths (or test cases) throughthe flowgraph that is adequate for statement coverage but notedge/branch coverage. [4 marks]
int CalculateDeviation(int x, int y) {a int total=0;b if (x>30) {c total=(x*40+y*50)*.95; }d for (int i=0;i<y;i++) {e total+=y*5; }f return total;}
(a) Draw the flow graph corresponding to the methodCalculateDeviation. [4 marks]
(b) Describe the minimum set of paths (or test cases) throughthe flowgraph that is adequate for statement coverage but notedge/branch coverage. [4 marks]