From 06eddd8605e965efc3658cb6c4748c29c491712f Mon Sep 17 00:00:00 2001 From: Kamal Wickramanayake Date: Sun, 15 Mar 2026 12:33:42 +0530 Subject: OOA/OOD/OOP example of Point of Sale system --- oop/10-point-of-sale/.vscode/settings.json | 7 +++++ oop/10-point-of-sale/README.md | 18 ++++++++++++ .../src/lk/ac/pdn/ceit/pos/Item.java | 34 ++++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 oop/10-point-of-sale/.vscode/settings.json create mode 100644 oop/10-point-of-sale/README.md create mode 100644 oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/Item.java (limited to 'oop/10-point-of-sale') diff --git a/oop/10-point-of-sale/.vscode/settings.json b/oop/10-point-of-sale/.vscode/settings.json new file mode 100644 index 0000000..0ac215c --- /dev/null +++ b/oop/10-point-of-sale/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "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 new file mode 100644 index 0000000..a43b9f6 --- /dev/null +++ b/oop/10-point-of-sale/README.md @@ -0,0 +1,18 @@ +## 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/src/lk/ac/pdn/ceit/pos/Item.java b/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/Item.java new file mode 100644 index 0000000..08567c7 --- /dev/null +++ b/oop/10-point-of-sale/src/lk/ac/pdn/ceit/pos/Item.java @@ -0,0 +1,34 @@ +package lk.ac.pdn.ceit.pos; + +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; + } + + +} -- cgit v1.2.3