java.lang.ObjectProduct
public class Product
Models a Product that can increase and decrease in price
Constructor Summary | |
---|---|
Product(double thePrice,
java.lang.String theDescription)
Constructs a Product with a price and a description |
Method Summary | |
---|---|
java.lang.String |
getDescription()
Gets the description |
double |
getPrice()
Gets the price |
void |
increasePrice(double percent)
Increases the price by the given percent |
void |
reducePrice(double percent)
Reduces the price of this product by the give percentage |
Methods inherited from class |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Product(double thePrice, java.lang.String theDescription)
thePrice
- the price of this ProducttheDescription
- - the description of this productMethod Detail |
---|
public java.lang.String getDescription()
public double getPrice()
public void increasePrice(double percent)
percent
- the percent to increase the price bypublic void reducePrice(double percent)
percent
- the percentage to reduce the priice by