To achieve 100% decision coverage, we need to ensure that every decision (if statement) in the code has been tested for both true and false outcomes. Let's analyze the code and count the decisions:
IF (Room_price > 200)
IF (Loyalty_level = Platinum) inside Room_price > 200
ELSE within the same decision above
IF (Loyalty_level = Gold) inside the ELSE of decision 2
IF (Room_price > 150)
IF (Loyalty_level = Platinum) inside Room_price > 150
ELSE within the same decision above
IF (Discount_factor < 100%)
To cover all these decisions, we need test cases for each possible combination:
Room_price > 200 and Loyalty_level = Platinum.
Room_price > 200 and Loyalty_level = Gold.
Room_price > 200 and Loyalty_level not Platinum or Gold.
Room_price <= 200 and Room_price > 150, and Loyalty_level = Platinum.
Room_price <= 200 and Room_price > 150, and Loyalty_level not Platinum.
Room_price <= 150.
From these scenarios, we can see that the minimum number of test cases required to achieve 100% decision coverage is four:
Test with Room_price > 200 and Loyalty_level = Platinum (tests decision 1 true, 2 true, and 8 true).
Test with Room_price > 200 and Loyalty_level = Gold (tests decision 1 true, 2 false, 4 true, and 8 true).
Test with Room_price > 200 and Loyalty_level not Platinum or Gold (tests decision 1 true, 2 false, 4 false, and 8 true).
Test with Room_price <= 200 and Room_price > 150, and Loyalty_level = Platinum (tests decision 1 false, 5 true, 6 true, and 8 true).
Test with Room_price <= 200 and Room_price > 150, and Loyalty_level not Platinum (tests decision 1 false, 5 true, 6 false, and 8 true).
Test with Room_price <= 150 (tests decision 1 false, 5 false, and 8 false).
Given that these six cases test all branches, four test cases are required to ensure that all decisions are covered at least once.
Therefore, the correct answer is A. 4.