1. Engineering
  2. Computer Science
  3. my instructor told me to get rid of milestoneoneingredientclass and...

Question: my instructor told me to get rid of milestoneoneingredientclass and...

Question details

my instructor told me to: get rid of MilestoneOne_IngredientClass and put the main method inside of the Ingredient class, where in my code you that go?

/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

package milestoneone_ingredientclass;

import java.util.ArrayList;

/**

*

* @author jennifer.cook_snhu

*/

public class MilestoneOne_IngredientClass {

    /**

     * @param args the command line arguments

     */

    public static void main(String[] args) {

        /**

         * Ingredient class : items that will be stored in each recipe

         *

         */

    public class Ingredient {

      

        private String ingredientName;

        private double ingredientAmount;

        private String unitMeasurement;

        private double totalCalories;

        public Ingredient() {

        }

  

        public Ingredient(String ingredientName, double ingredientAmount, String unitMeasurement, double totalCalories) {

            super();

            this.ingredientName = ingredientName;

            this.ingredientAmount = ingredientAmount;

            this.unitMeasurement = unitMeasurement;

            this.totalCalories = totalCalories;

   

    }

       

        public String getIngredientName() {

            return ingredientName;

        }

        public void setIngredientName(String ingredientName) {

            this.ingredientName = ingredientName;

        }

        public double getIngredientAmount() {

            return ingredientAmount;

        }

        public void setIngredientAmount(double ingredientAmount) {

            this.ingredientAmount = ingredientAmount;

        }

        public String getUnitMeasurement() {

            return unitMeasurement;

        }

        public void setUnitMeasurement(String unitMeasurement) {

            this.unitMeasurement = unitMeasurement;

        }

        public double getTotalCalories() {

            return totalCalories;

        }

        public void setTotalCalories(double totalCalories) {

            this.totalCalories = totalCalories;

        }

       

        public void printItemDetails() {

            System.out.println("ingredientName " + this.ingredientName);

            System.out.println("ingredientAmount " + this.ingredientAmount);

            System.out.println("totalCalories " + this.totalCalories);

            System.out.println("unitMeasurement " + this.unitMeasurement);

    }

    }

}

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution