Challenge 3.2 Add to cart / Shopping Cart
Hi guys, I am trying to solve the following challenge, but I think I am making a mistake in the use of the object instance. Does anyone have any hint for my problem? The problem Statement is the following: . Shopping Cart You are building a Shopping Cart. It is represented by a Cart struct, which holds the item prices in an array called prices. Your program needs to take the number of items as input, followed by the prices of the items. Initialize a Cart of that size, and add the prices to the Cart's array. After that, call the Cart's show() method. The show() method should output the total cost of the cart. The given code includes comments as instructions. Use a normal loop to take the inputs, and a range loop to calculate the sum of all prices. Also, note that the prices are floats. .