Objects Group Work Procedure
- Add two new member variables to your food item representing two additional food attributes about ANY GIVEN food item. Total Fat, for example. Or a boolean representing if the food item is meant for humans.
- Create instances of FoodItem in the main method of FoodLand for each member of your group. Your variable names could be something like: lorettasItem and crusoesItem
- Once you have instances, assign appropriate values to each instance's member variables, such as lorrettasItem.caloriesPerServing = 140;
- Compose a method called displayNutritionInfo that accepts an instance of a FoodItem and dumps its membe variables to the console.
- Extension project for Monday: Create a method in FoodLand that will accept both a FoodItem intance and double value representing the number of servings consumed. The job of the method is to compute total calories consumed by multiplying calories per serving by the number of services eaten.
- Screen shot your code from the group and save in our objects artifacts cloud drive.