Q1_20251120125437.webp
I

Q1_20251120125437.webp

33.
34.
35.
36. }
return sum;
}
}
Question 2 (3 points): Assuming you are assigned to conduct the component test for the method
below, please design and create the minimum component test cases (Unit Test case) needed to
achieve 100% statement covergage and 100% decision coverage. (Use question 2 template)
Note: Assume all parameters are provided and have the correct data types.
1. double calculate Insurance Fee (int vehicleType, int age, int years Experience, boolean isVIP) {
double baseFee;
Zoom
2.
3.
4.
switch (vehicleType) {
5.
case 1: baseFee
6.
case 2: baseFee
7.
8.
9.
1000000; break; // Motorcycle
5000000; break; // Car (under 7 seats)
case 3: baseFee = 7000000; break; // Truck
case 4: baseFee = 10000000; break; // Bus
default: return -1; // Invalid vehicle type
10.
}
11.
12.
13.
14.
15.
int ageGroup;
if (age < 25) {
}else if (age <= 60) {
ageGroup 1; // Under 25
16.
ageGroup
2; // 25-60
17.
} else {
18.
ageGroup 3; // Over 60
19.
}
20.
+ 100%
Close
Chưa có bình luận nào.

Thông tin

Category
SWT301
Thêm bởi
Inumaki871
Ngày thêm
Lượt xem
5,315
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom