public class ShoppingCart
extends java.lang.Object
Constructor and Description |
---|
ShoppingCart() |
Modifier and Type | Method and Description |
---|---|
void |
addItem(Item item)
Adds an item to the cart
|
float |
getTotalCost() |
void |
removeItem(int i)
Removes the item in the selected position
|
void |
showDetails()
Displays the details of each item in the
cart in the console.
|
public void addItem(Item item)
item:
- item for additionpublic void removeItem(int i)
i:
- position of item for deletionpublic float getTotalCost()
public void showDetails()