// Helene Martin, CSE 142 // Prints a recipe for making sugar cookies. // goal: demonstrate procedural decomposition // static methods capture structure and reduce redundancy public class BakeCookies { public static void main(String[] args) { makeBatter(); bakeCookies(); bakeCookies(); bakeCookies(); bakeCookies(); bakeCookies(); bakeCookies(); bakeCookies(); decorateCookies(); } // makes the batter public static void makeBatter() { System.out.println("Mix the dry ingredients."); System.out.println("Cream the butter and sugar."); System.out.println("Beat in the eggs."); System.out.println("Stir in the dry ingredients."); } // bake cookies public static void bakeCookies() { System.out.println("Set the oven temperature."); System.out.println("Set the timer."); System.out.println("Place a batch of cookies into the oven."); System.out.println("Allow the cookies to bake."); } // decorate cookies public static void decorateCookies() { System.out.println("Mix ingredients for frosting."); System.out.println("Spread frosting and sprinkles."); } }