CJCoding With Joseph

Shopping Cart Class

Create a class ShoppingCart that stores item prices in a private List<double>. Add(double price) puts a price in the cart, and Total() returns the sum of all prices. Do not write a Main method.

After adding 10.0, 5.5, and 4.5 the program prints:
20

Expected Output:

20
Topics:
Classes
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cw, cr, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.