2020-11-11 08:47:37 -05:00
|
|
|
/*
|
|
|
|
* Following Specs:
|
|
|
|
* Init in default constructor:
|
|
|
|
*
|
|
|
|
* String itemName -- init to none
|
|
|
|
* int itemPrice - init to 0
|
|
|
|
* int itemQuanity - init to 0
|
|
|
|
*
|
|
|
|
* Public member mothods (mutators & accessors)
|
|
|
|
* setPrice() & getPrice()
|
|
|
|
*/
|
2020-11-11 09:20:45 -05:00
|
|
|
|
|
|
|
public class ItemToPurchase {
|
|
|
|
private String itemName;
|
|
|
|
private int itemPrice;
|
|
|
|
private int itemQuantity;
|
|
|
|
|
|
|
|
public ItemToPurchase() {
|
|
|
|
itemName = "none";
|
|
|
|
itemPrice = 0;
|
|
|
|
itemQuantity = 0;
|
|
|
|
}
|
|
|
|
public void setName(String name){
|
|
|
|
this.itemName = name;
|
|
|
|
}
|
|
|
|
public String getName(){
|
|
|
|
return itemName;
|
|
|
|
}
|
|
|
|
public void setQuantity(int q){
|
|
|
|
this.itemQuantity = q;
|
|
|
|
}
|
|
|
|
public int getQuantity(){
|
|
|
|
return itemQuantity;
|
|
|
|
}
|
|
|
|
public void setPrice(int p){
|
|
|
|
this.itemPrice = p;
|
|
|
|
}
|
|
|
|
public int getPrice(){
|
|
|
|
return itemPrice;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|