From 5f5ac2c4ce62370257a26c5f15dbef577f4bc1c7 Mon Sep 17 00:00:00 2001 From: Kamal Wickramanayake Date: Sun, 22 Mar 2026 21:31:29 +0530 Subject: Deleted oop/10-point-of-sale since 11-point-of-sale has been added --- oop/10-point-of-sale/.gitignore | 1 - oop/10-point-of-sale/.vscode/settings.json | 7 ---- oop/10-point-of-sale/README.md | 18 --------- oop/10-point-of-sale/docs/01-requirements.txt | 19 --------- .../docs/02-analysis-domain-model.png | Bin 150756 -> 0 bytes .../docs/03-design-class-diagram.png | Bin 45999 -> 0 bytes .../src/lk/ac/pdn/ceit/pos/App.java | 16 -------- .../src/lk/ac/pdn/ceit/pos/PointOfSale.java | 33 ---------------- .../src/lk/ac/pdn/ceit/pos/TextUI.java | 27 ------------- .../src/lk/ac/pdn/ceit/pos/entities/Bill.java | 17 -------- .../src/lk/ac/pdn/ceit/pos/entities/Item.java | 34 ---------------- .../src/lk/ac/pdn/ceit/pos/entities/LineItem.java | 29 -------------- .../ac/pdn/ceit/pos/item/InMemoryItemManager.java | 43 --------------------- .../src/lk/ac/pdn/ceit/pos/item/ItemManager.java | 11 ------ 14 files changed, 255 deletions(-) delete mode 100644 oop/10-point-of-sale/.gitignore delete mode 100644 oop/10-point-of-sale/.vscode/settings.json delete mode 100644 oop/10-point-of-sale/README.md delete mode 100644 oop/10-point-of-sale/docs/01-requirements.txt delete mode 100644 oop/10-point-of-sale/docs/02-analysis-domain-model.png delete mode 100644 oop/10-point-of-sale/docs/03-design-class-diagram.png delete mode 100644 oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/App.java delete mode 100644 oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/PointOfSale.java delete mode 100644 oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/TextUI.java delete mode 100644 oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/entities/Bill.java delete mode 100644 oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/entities/Item.java delete mode 100644 oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/entities/LineItem.java delete mode 100644 oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/item/InMemoryItemManager.java delete mode 100644 oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/item/ItemManager.java diff --git a/oop/10-point-of-sale/.gitignore b/oop/10-point-of-sale/.gitignore deleted file mode 100644 index ba077a4..0000000 --- a/oop/10-point-of-sale/.gitignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/oop/10-point-of-sale/.vscode/settings.json b/oop/10-point-of-sale/.vscode/settings.json deleted file mode 100644 index 0ac215c..0000000 --- a/oop/10-point-of-sale/.vscode/settings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "java.project.sourcePaths": ["src"], - "java.project.outputPath": "bin", - "java.project.referencedLibraries": [ - "lib/**/*.jar" - ] -} diff --git a/oop/10-point-of-sale/README.md b/oop/10-point-of-sale/README.md deleted file mode 100644 index a43b9f6..0000000 --- a/oop/10-point-of-sale/README.md +++ /dev/null @@ -1,18 +0,0 @@ -## Getting Started - -Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code. - -## Folder Structure - -The workspace contains two folders by default, where: - -- `src`: the folder to maintain sources -- `lib`: the folder to maintain dependencies - -Meanwhile, the compiled output files will be generated in the `bin` folder by default. - -> If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there. - -## Dependency Management - -The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies). diff --git a/oop/10-point-of-sale/docs/01-requirements.txt b/oop/10-point-of-sale/docs/01-requirements.txt deleted file mode 100644 index 86e497a..0000000 --- a/oop/10-point-of-sale/docs/01-requirements.txt +++ /dev/null @@ -1,19 +0,0 @@ -A POS needs to be created. A customer would come to the cashier and the cashier would take items from the cart and enter the item ids to the system. The system would ask the number of items to be purchased. The system would create a bill and add line items to it. At the end, the total should be calculated and the tax should be added. The system would ask to enter the amount of money the customer would give. The system should print the entire bill with the balance to be given back to the customer. - -POS (system) - -Customer - -Cashier - -Item - itemId - -LineItem - quantity - -Bill - total - taxAmount - moneyGivenByCustomer - balanceToBeGivenToCustomer diff --git a/oop/10-point-of-sale/docs/02-analysis-domain-model.png b/oop/10-point-of-sale/docs/02-analysis-domain-model.png deleted file mode 100644 index 26396e4..0000000 Binary files a/oop/10-point-of-sale/docs/02-analysis-domain-model.png and /dev/null differ diff --git a/oop/10-point-of-sale/docs/03-design-class-diagram.png b/oop/10-point-of-sale/docs/03-design-class-diagram.png deleted file mode 100644 index c4da864..0000000 Binary files a/oop/10-point-of-sale/docs/03-design-class-diagram.png and /dev/null differ diff --git a/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/App.java b/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/App.java deleted file mode 100644 index c3f1037..0000000 --- a/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/App.java +++ /dev/null @@ -1,16 +0,0 @@ -package lk.ac.pdn.ceit.pos; - -import lk.ac.pdn.ceit.pos.item.InMemoryItemManager; -import lk.ac.pdn.ceit.pos.item.ItemManager; - -public class App { - public static void main(String[] args) throws Exception { - ItemManager itemManager = new InMemoryItemManager(); - - PointOfSale pos = new PointOfSale(itemManager); - - TextUI ui = new TextUI(pos); - - ui.start(); - } -} diff --git a/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/PointOfSale.java b/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/PointOfSale.java deleted file mode 100644 index dfac6e1..0000000 --- a/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/PointOfSale.java +++ /dev/null @@ -1,33 +0,0 @@ -package lk.ac.pdn.ceit.pos; - -import lk.ac.pdn.ceit.pos.entities.Bill; -import lk.ac.pdn.ceit.pos.entities.Item; -import lk.ac.pdn.ceit.pos.entities.LineItem; -import lk.ac.pdn.ceit.pos.item.ItemManager; - -public class PointOfSale { - - private ItemManager itemManager; - - private Bill bill; - - public PointOfSale(ItemManager itemManager) { - this.itemManager = itemManager; - } - - public Bill createNewBill() { - bill = new Bill(); - return bill; - } - - public void addLineItem(String itemId, int quantity) { - // From the ItemManager, get the Item. - Item item = itemManager.findById(itemId); - - // Create a new LineItem and associate it with the item returned - LineItem lineItem = new LineItem(item, quantity); - - // Add the new LineItem to the bill - bill.getLineItems().add(lineItem); - } -} diff --git a/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/TextUI.java b/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/TextUI.java deleted file mode 100644 index 056e41e..0000000 --- a/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/TextUI.java +++ /dev/null @@ -1,27 +0,0 @@ -package lk.ac.pdn.ceit.pos; - -import lk.ac.pdn.ceit.pos.entities.Bill; - -public class TextUI { - private PointOfSale pos; - - public TextUI(PointOfSale pos) { - this.pos = pos; - } - - public void start() { - IO.println("POS Started."); - - // Assume a bill should be created. - Bill bill = pos.createNewBill(); - - // Assume: Create a line item - pos.addLineItem("F001", 2); - - pos.addLineItem("F002", 3); - - // ... - - // Print bill - } -} diff --git a/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/entities/Bill.java b/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/entities/Bill.java deleted file mode 100644 index ad6a87e..0000000 --- a/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/entities/Bill.java +++ /dev/null @@ -1,17 +0,0 @@ -package lk.ac.pdn.ceit.pos.entities; - -import java.util.ArrayList; -import java.util.List; - -public class Bill { - private List lineItems = new ArrayList<>(); - - public List getLineItems() { - return lineItems; - } - - public void setLineItems(List lineItems) { - this.lineItems = lineItems; - } - -} diff --git a/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/entities/Item.java b/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/entities/Item.java deleted file mode 100644 index 47b8e32..0000000 --- a/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/entities/Item.java +++ /dev/null @@ -1,34 +0,0 @@ -package lk.ac.pdn.ceit.pos.entities; - -public class Item { - private String name; - private String id; - private double unitPrice; - - public Item(String name, String id, double unitPrice) { - this.name = name; - this.id = id; - this.unitPrice = unitPrice; - } - - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public double getUnitPrice() { - return unitPrice; - } - public void setUnitPrice(double unitPrice) { - this.unitPrice = unitPrice; - } - - -} diff --git a/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/entities/LineItem.java b/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/entities/LineItem.java deleted file mode 100644 index ad6abaf..0000000 --- a/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/entities/LineItem.java +++ /dev/null @@ -1,29 +0,0 @@ -package lk.ac.pdn.ceit.pos.entities; - -public class LineItem { - private Item item; - private int quantity; - - public LineItem(Item item, int quantity) { - this.item = item; - this.quantity = quantity; - } - - public Item getItem() { - return item; - } - - public void setItem(Item item) { - this.item = item; - } - - public int getQuantity() { - return quantity; - } - - public void setQuantity(int quantity) { - this.quantity = quantity; - } - - -} diff --git a/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/item/InMemoryItemManager.java b/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/item/InMemoryItemManager.java deleted file mode 100644 index 00bc835..0000000 --- a/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/item/InMemoryItemManager.java +++ /dev/null @@ -1,43 +0,0 @@ -package lk.ac.pdn.ceit.pos.item; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import lk.ac.pdn.ceit.pos.entities.Item; - -public class InMemoryItemManager implements ItemManager { - - // Assume this is the item storage - private Map items = new HashMap<>(); - - // Initial set of data for demo purposes - public InMemoryItemManager() { - this.create("Dhal", "F001", 300.00); - this.create("Bread", "F002", 180.00); - this.create("Sunlight Soap", "S001", 150.00); - } - - @Override - public Item findById(String id) { - return items.get(id); - } - - @Override - public List searchByName(String word) { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'searchByName'"); - } - - @Override - public Item create(String name, String id, double unitPrice) { - // Create a new Item - Item item = new Item(name, id, unitPrice); - - // Add to storage - items.put(id, item); - - return item; - } - -} diff --git a/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/item/ItemManager.java b/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/item/ItemManager.java deleted file mode 100644 index 5c6b47e..0000000 --- a/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/item/ItemManager.java +++ /dev/null @@ -1,11 +0,0 @@ -package lk.ac.pdn.ceit.pos.item; - -import java.util.List; - -import lk.ac.pdn.ceit.pos.entities.Item; - -public interface ItemManager { - public Item findById(String id); - public List searchByName(String word); - public Item create(String name, String id, double unitPrice); -} -- cgit v1.2.3