/** Representation of a pet for a pet store simulation */ public abstract class Pet { // instance variables private double weight; // pet weight in pounds private String name; // name of pet /** Construct a new pet with the given name and weight */ public Pet(String name, double weight) { this.name = name; this.weight = weight; } /** Return this pet's name */ public String getName() { return name; } /** Return this pet's weight */ public double getWeight() { return weight; } /** Eat the supplied food */ public void eat(String food) { System.out.println("Yum! I love " + food); } /** Respond with the noise made by this pet * (Must be overridden in extended classes) */ public abstract String speak(); }