school/Week-11-final-start/part-1/ItemToPurchase.java
2020-11-11 09:20:45 -05:00

45 lines
767 B
Java

/*
* 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()
*/
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;
}
}