/** * Author: Josiah Yoder et al. * Class: SE1011-011 * Lesson: Week 6, Day 1 */ import javax.swing.JOptionPane; public class Dog051_6_2 { private String breed; private boolean hasFleas; private boolean hasTail; private String name; public Dog051_6_2(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!!!"); } }