public class Clown { private int height; private String behaviour; private String shoes; public Clown() { height = (int)(Math.random() * 13) + 60; //60 to 72 inches (5' to 6') behaviour = randomBehaviour(); shoes = randomShoes(); } private String randomBehaviour() { String[] behaviours = {"happy", "silly", "cranky", "giggly"}; int size = behaviours.length; int rn = (int)(Math.random() * size); return behaviours[rn]; } private String randomShoes() { String[] shoes = {"big blue", "floppy red", "sparkly purple"}; int size = shoes.length; int rn = (int)(Math.random() * size); return shoes[rn]; } public String toString() { String heightAttribute = height < 66 ? "short" : "tall"; return "A " + heightAttribute + " " + behaviour + " clown with " + shoes + " shoes."; } public void makeAngry() { behaviour = "angry"; } }