diff --git a/Domain_model.md b/Domain_model.md new file mode 100644 index 0000000..b50d8b9 --- /dev/null +++ b/Domain_model.md @@ -0,0 +1,24 @@ +``` +As a supermarket shopper, +So that I can pay for products at checkout, +I'd like to be able to know the total cost of items in my basket. +``` + +| Classes | Method | Scenario | Outputs | +|----------|------------------------------------|---------------------|------------| +| `Basket` | `CalculateTotalCost(List)` | If basket has items | Total cost | +| | | If no items | 0 | +| | | | | + +``` +As an organised individual, +So that I can evaluate my shopping habits, +I'd like to see an itemised receipt that includes the name and price of the products +I bought as well as the quantity, and a total cost of my basket. +``` + +| Classes | Method | Scenario | Outputs | +|----------|---------------------------------------------------|---------------------|-------------------------------------| +| `Basket` | `GetItemandPrice(HashMap items)` | If basket has items | Gets all the items from the Basket | +| | `GetQuantityFromBasket()` | If basket has items | Quantity of each prodocut in Basket | +| | `GetTotalPriceandlist()` | If basket has items | Total cost and list | diff --git a/domain-model.md b/domain-model.md new file mode 100644 index 0000000..b50d8b9 --- /dev/null +++ b/domain-model.md @@ -0,0 +1,24 @@ +``` +As a supermarket shopper, +So that I can pay for products at checkout, +I'd like to be able to know the total cost of items in my basket. +``` + +| Classes | Method | Scenario | Outputs | +|----------|------------------------------------|---------------------|------------| +| `Basket` | `CalculateTotalCost(List)` | If basket has items | Total cost | +| | | If no items | 0 | +| | | | | + +``` +As an organised individual, +So that I can evaluate my shopping habits, +I'd like to see an itemised receipt that includes the name and price of the products +I bought as well as the quantity, and a total cost of my basket. +``` + +| Classes | Method | Scenario | Outputs | +|----------|---------------------------------------------------|---------------------|-------------------------------------| +| `Basket` | `GetItemandPrice(HashMap items)` | If basket has items | Gets all the items from the Basket | +| | `GetQuantityFromBasket()` | If basket has items | Quantity of each prodocut in Basket | +| | `GetTotalPriceandlist()` | If basket has items | Total cost and list |