This question belongs to Swift Programming Language , especially the domains covering basic Swift types , operators , and constants versus variables .
There are two compile problems in the snippet. First, unitPrice and shipping are inferred as Double, while quantity is inferred as Int. In Swift, arithmetic operands must have compatible types; Swift does not automatically mix Int and Double in one arithmetic expression. So unitPrice * quantity fails unless quantity is changed to Double or explicitly converted. That makes A a correct fix.
Second, the line totalCost += ... uses the compound assignment operator +=, which stores a new value back into the left-hand side. Swift requires the left-hand side of += to be mutable, so totalCost must be declared with var, not let. That makes D the second correct fix.
The other choices do not solve the actual compile issues. B is unnecessary because totalCost is already explicitly declared as Double, so 0 is valid there. C would still leave shipping as Double, so the mixed-type arithmetic problem remains. E is irrelevant because shipping is never reassigned. Therefore, the two correct answers are A and D
Submit