Question: Program Description A local bakery is looking to build a small application that helps to determine total amounts of sugar, butter, flour and chocolate chips
Program Description
A local bakery is looking to build a small application that helps to determine total amounts of sugar, butter, flour and chocolate chips needed to bake batches of cookies. Write a program that will help the bakery get information about batches of orders. Then, calculate and display the ingredient information in a brief report.
Use the following instructions to code the program:
File Cookie.java
Write a Cookie class that must have fields for the following:
The number of cookies in the batch
The cups of sugar
The cups of butter
The cups of flour
The cups of chocolate chips
The Cookie class must also contain the following methods:
A constructor that doesnt accept arguments.
A constructor that accepts an argument for the number of cookies field and calls the calculateIngredients method below.
Appropriate accessor and mutator methods ie setters and getters
A method named calculateIngredients that accepts no arguments and calculates the amounts of sugar, butter, flour, and chocolate chips needed to make the batch of cookies based on the bakerys recipe.
This bakery has standard amounts of ingredients based on a recipe that makes chocolate chip cookies. Per cookies, the following ingredients are needed: cups of sugar, cup of butter, cups of flour, and cups of chocolate chips. To calculate the amounts required, you will need to use the ratio of ingredient per cookies, then multiply times the number of cookies in the batch. You can use the following formula as a guide:
Amount of Ingredient needed for Batch number cookies in batch Recipe Amount of Ingredient
For example, to calculate the number of cups of sugar needed for the batch of cookies, do the following: cups sugar number of cookies in the batch
A toString method that displays the ingredients needed for the batch and the calculated number of cups of sugar, butter, flour, and chocolate chips needed to make the batch of cookies.
File Demo.java
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
