public class Bill { private int value; private Dimensions dimensions; private String celebrity; private double damage; public Bill(int value, int width, int height, String celebrity) { this.value = value; this.dimensions = new Dimensions(width, height); this.celebrity = celebrity; this.damage = 1; } public void useBill(){ this.damage -= 0.01; } public double getDamage() { return damage; } public void setDamage(double damage) { this.damage = damage; } public int getValue() { return value; } public void setValue(int value) { this.value = value; } public int getWidth() { return dimensions.getWidth(); } public void setWidth(int width) { this.dimensions.setWidth(width); } public int getHeight() { return dimensions.getHeight(); } public void setHeight(int height) { this.dimensions.setHeight(height); } public String getCelebrity() { return celebrity; } public void setCelebrity(String celebrity) { this.celebrity = celebrity; } @Override public String toString() { return "Bill{" + "value=" + value + ", width=" + getWidth() + ", height=" + getHeight() + ", celebrity='" + celebrity + '\'' + ", damage=" + convertDamageToString() + '}'; } private String convertDamageToString(){ return Math.round((1-damage)*100) + " %"; } }