if (customerType == 'S') { // Student
totalPrice totalPrice 10 / 100; // 10% discount
} else if (customerType == '0') { // Older adult
totalPrice totalPrice 15 / 100; // 15% discount
31.
32.
33.
34.
35.
}
36.
37.
38. }
return totalPrice;
Question 3 (4 points): You are assigned to do the functional (black-box) test for Gold Price
Calculator function. Writing test cases for this function with the content described below. (Use
question 3 template)
Function Description: This function allows users to estimate the total value of gold based on
weight, purity, base price per gram, and transaction mode (Buy or Sell). The function supports
multiple gold purity levels and units used in Vietnam (Gram, Chi, Tael).
Screen Layout:
Zoom
- FUO
+ 100%
Gold Purity:
24K (99.9%)
Weight:
15
Gold Price Calculator
Unit:
Chi (Vietnamese mace, 3.75g)
Base Price (VND/aram):
Close