- /**
- * The Farm class
provides an exercise in the use of Java classes
- * and object's features.
- * @author TK Rogers
- * @version 9/30/2010
- */
- public class Farm
- {
- // Note that this project is an application
not an applet.
- // Applications are started with a main
method
public static void main ( ) {
- // Create 3 local pumpkin objects with
- // different weights.
(Note: the term local
- // means
that the objects are to be created
- // inside a
method, in this case the
main method.)
- //
- // Output the total weight and price
- // of all
the pumpkins.
- //
- // Output the
weight and price of each
- //
individual pumpkin.
- //
- // Using a
single for loop to repeatedly call the grow
- // method
for each pumpkin, Have all the pumpkins
- // grow for
5 weeks and Re-output the the weight
- // and
price of each individual pumpkin.
}
}