/** * Author: Josiah Yoder et al. * Class: SE1011-051 * Lesson: Week 6, Day 1 */ import javax.swing.JOptionPane; public class Dog { private String breed; private boolean hasFleas; private boolean hasTail; private String name; public Dog(String name) { this.name=name; } public String getName() { return name; } public String getBreed() { return breed; } public void setHasFleas(boolean hasFleas) { this.hasFleas = hasFleas; } public void setBreed(String breed) { this.breed = breed; } public void takeBath() { hasFleas = false; } public void rollInGrass() { hasFleas = true; } public String toString() { String fleasString = ""; if(hasFleas) { fleasString = "has fleas"; } else { fleasString = "has no fleas"; } return name+" is a dog and it "+fleasString; } public void bark() { JOptionPane.showMessageDialog(null,"Woof!!!"); } }