3
4
5
6
7
8
9
public static int divideAndRound(int dividend, int divisor) {
if (divisor == 0) {
throw new IllegalArgumentException("Divisor cannot be zero.");
}
int result dividend / divisor;
if (result < 0) {
if (dividend % divisor != 0) {
10
11
12
13
14
result--;
}
} else if (result > 0) {
if (dividend % divisor != 0) {
15
16
17
18
result++;
}
}
return result;
}
19
Question 3 (4 points): You are assigned to do the functional (black-box) test for function Create a new receive
Phiếu thu tiền mặt
Đối tượng
Zoom
Ngày
11/12/2020
100%
Close