Fix the Scala Method
Fix the missing semicolons and the Int type, ensure the floating point division, and remove the unnecessary return.
def calculateTotalPrice(items List[Double], discountPercentage int): Double = { val subtotal = items.sum val discountAmount = subtotal * (discountPercentage / 100) val total = subtotal - discountAmount return total }
def calculateTotalPrice(items: List[Double], discountPercentage: Int): Double = { val subtotal = items.sum val discountAmount = subtotal * (discountPercentage / 100.0) val total = subtotal - discountAmount total }