Bot program to count the products bought in the supermarket, with total sum.
struct product { var name: String var price: Double var count: Int } var products: [product] func add(prd: product) { products.append(prd) } func totalSum() -> Double { var sum: Double = 0 for i in 0..<products.count { sum += Double(products[i].count) * products[i].price } return sum }