public void decrement(View view){ quantity = quantity - 1; displayQuantity(quantity); } public void submitOrder(View view){ CheckBox = whippedCreamCheckBox = (CheckBox) findViewById(R.id.whipped_cream_checkbox); boolean hasWhippedCream = whippedCreamCheckBox.isChecked(); Log.v("MainActivity", "Has whipped cream; " + hasWhippedCream); int price = calculatePrice(); String priceMessage = createOrderSummary(price, hasWhippedCream); displayMessage(priceMEssage); } private int calculatePrice(){ return quantity * 5; } private String createOrderSummary(int price, boolean addWhippedCream){ String priceMessage = "Name: Lyla the Labyrinth"; priceMessage += "\nQuantity: " + quantity; priceMessage += "\nTotal: $" + price; priceMessage += "\nThank you!"; return priceMessage; }

