Decoding the perfect order puzzle

Report a typo

Hey there! This problem might be a bit unpredictable, but give it a go and let us know how you do!

Fill in the blanks in the code to create a function that processes a customer's order. The function should take an order ID, quantity, price, and an optional discount. Then, call the function using named arguments, setting the quantity to 5, price to 19.99, order ID to 1001, and discount to 0.1.

Fill in the gaps with the relevant elements
 (orderId: Int, : Int, : Double, : Double = 0.0) {
    println("Order processed: $orderId, $quantity items, $price each, $discount discount")
}
processOrder(quantity = 5, price = 19.99, orderId = 1001, discount = 0.1)
processOrderfuncfunquantityorderProcessdiscountdeductionamountcostprice

Create a free account to access the full topic