calculatePrice method

num calculatePrice({
  1. required num price,
  2. required num quantity,
})

Calculates the total price for a product based on its price and quantity.

  • price: The price of the product.
  • quantity: The quantity of the product.

Returns the total price for the product.

Implementation

num calculatePrice({
  required num price,
  required num quantity,
}) =>
    price * quantity;