- /**
- * Pumpkin class defines
a pumpkin properties.
- *
- * @author TK Rogers
- * @version (a version number or a date)
- */
public class Pumpkin {
- private double weight;
- public static double pricePerPound = .25;
-
- //
Constructor
- public Pumpkin (double pounds) {
- weight = pounds;
- }
- public
void setWeight (double pound) {
- weight = pound;
- }
- public double getWeight ( ) {
-
return weight;
- }
- //One week of growth for a pumpkin
- public void grow ( ) {
- weight += 0.5;
- }
}