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 1- 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 (i.e., 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 48 chocolate chip cookies. Per 48 cookies, the following ingredients are needed: 1.5 cups of sugar, 1 cup of butter, 2.75 cups of flour, and 3.9 cups of chocolate chips. To calculate the amounts required, you will need to use the ratio of ingredient per 48 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 /48)
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 *(1.5/48).
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 2- Demo.java

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!