Question: Write well - documented JUnit test cases and a well - documented Java class containing the method Fun in Task 1 ( use class name

Write well-documented JUnit test cases and a well-documented Java class containing
the method Fun in Task 1(use class name T2), and show the code coverage obtained when
1. public int Fun(int x, int k, int y){
2. int i;
3. for (i = x; i < y; i++){
4. if (x%5<3){
5. k = y - x;
6. y = y + i;
7.}
8. else{
9. x = k -2;
10. y = y + x;
11.}
12. y = y - x;
13. i = i +2;
14.}
15. if (x <0|| y <0){
16. k = y x;
17.}
18. else{
19. x = y + k;
20.}
21. return x;
22.}
executing the test cases developed for

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!