Category class
The domain classes making up the application are;
- Category class
- Discount class
- Member class
- Product class
- Storekeeper class
- Transaction class
- Vendor class
The category class has private variables with each variable having a public accessor and mutator method. The following code shows the structure of the category class.
public class Category {
private String name;
private String code;
public Category(String code, String name){
this.name=name;
this.code=code;
public Category(){}
public String getName(){
return this.name;
public void setame(String name){
this.name=name;
public void setCode(String code){
this.code=code;
public String getCode(){
return this.code;
The Discount class has private variables with each variable having a public accessor and mutator method. The following code shows the structure of the discount class.
public class Discount {
private String code;
private String description;
private String startDate;
private String period;
private Double percentage;
private String member;
public Discount(String code, String description, String startDate, String period, double percentage, String member){
this.code=code;
this.member=member;
this.description=description;
this.period=period;
this.startDate=startDate;
this.percentage=percentage;
public Discount(){}
public String getCode(){
return this.code;
public void setCode(String code){
this.code=code;
public String getDescription(){
return this.description;
public void setDescription(String description){
this.description=description;
public String getStartDate(){
return this.startDate;
public void setStartDate(String startDate){
this.startDate=startDate;
public String getPeriod(){
return this.period;
public void setperiod(String period){
this.period=period;
public double getpercentage(){
return this.percentage;
public void setPercentage(double percentage){
this.percentage=percentage;
public String getMember(){
return this.member;
public void setMember(String member){
this.member=member; .
The Member class has private variables with each variable having a public accessor and mutator method. The following code shows the structure of the member class.
public class Member {
private String memberID,name;
private int points;
public Member(String name, String memberID){
this.memberID=memberID;
this.name=name;
this.points=0;
public Member(){}
public String getMemberID(){
return this.memberID;
public void setName(String name){
this.name=name; public String getName(){
return this.name;
public int getPoints(){
return this.points;
public void setPoints(int point){
this.points=points+point;
public void setMemberID(String memberID){
this.memberID=memberID;
The Product class has private variables with each variable having a public accessor and mutator method. The following code shows the structure of the product class.
public class Product {
private String productID;
private String name;
private String description;
private int quantity;
private int barcode;
private int reorder;
private int order;
private double price;
public Product(String productID,String name, String description, int quantity, double price, int barcode, int reorder, int order){
this.productID=productID;
this.name=name;
this.description=description;
this.quantity=quantity;
this.barcode=barcode;
this.reorder=reorder;
this.order=order;
this.price=price;
public Product(){}
public String getProductID(){
return this.productID;
public String getName(){
return this.name;
public String getDescription(){
return this.description;
public int getQuantity(){
return this.quantity;
public int getBarcode(){
return this.barcode;
public int getReorder(){
return this.reorder;
public int getOrder(){
return this.order;
public double getPrice(){
return this.price;
public void setProductID(String productID){
this.productID=productID;
public void setName(String name){
this.name=name;
public void setDescription(String description){
this.description=description;
public void setQuantity(int quantity){
this.quantity=quantity;
public void setBarcode(int barcode){
this.barcode=barcode;
public void setReorder(int reorder){
this.reorder=reorder;
public void setOrder(int order){
this.order=order;
public void setprice(double price){
this.price=price;
The Storekeeper class has private variables with each variable having a public accessor and mutator method. The following code shows the structure of the storekeeper class.
public class Storekeeper {
private String name;
private String password;
public Storekeeper(){
public Storekeeper(String name,String password){
this.name=name;
this.password=password;
public String getName(){
return this.name;
public void setPassword(String password){
this.password=password;
public void setName(String name){
this.name=name;
public String getPassword(){
return this.password;
The Transaction class has private variables with each variable having a public accessor and mutator method. The following code shows the structure of the transaction class.
public class Transaction {
private int transactionID;
private String product;
private String member;
private int quantity;
private String date;
public Transaction(int transactionID, String product, String member, int quantity, String date){
this.transactionID=transactionID;
this.product=product;
this.member=member;
this.quantity=quantity;
this.date=date;
public int getTransctionID(){
return this.transactionID;
public void setDate(String date){
this.date=date;
public String getProduct(){
return this.product;
public void setQuantity(int quantity){
this.quantity=quantity;
public String getMember(){
return this.member;
public int getQuantity(){
return this.quantity;
public void setMember(String member){
this.member=member;
public String getDate(){
return this.date;
public void setProduct(String product){
this.product=product;
public void setTransactionID(int transactionID){
this.transactionID=transactionID;
The Vendor class has private variables with each variable having a public accessor and mutator method. The following code shows the structure of the vendor class.
public class Vendor {
private String name;
private String description;
public Vendor(String name,String description){
this.name=name;
this.description=description;
public Vendor(){}
public void setDescription(String description){
this.description=description;
public String getName(){
return this.name;
public void setName(String name){
this.name=name;
public String getDescription(){
return this.description;