Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this assignment, you will practice doing I/O using Scanner or JOptionPane classes. You will gain experience using primitive variables, constants, String objects, and make

In this assignment, you will practice doing I/O using Scanner or JOptionPane classes. You will gain experience using primitive variables, constants, String objects, and make use of some Math methods

CupcakeRecipe Calculator Program

You are starting up your own Cupcake Company. The ingredients needed to make one batch of cupcakes are:

Ingredients

cup butter

1 cup white sugar

2 eggs

1 teaspoon vanilla extract

cup unsweetened cocoa powder

cup all-purpose flour

teaspoon salt

teaspoon baking powder

Write a class called YourNameCupcakeProgram that determines how many batches of cupcakes you can make with the number of eggs you have at home.

Your program should ask the user how many eggs are in their fridge.

The rest will be calculated.

How many batches of cupcakes will this many eggs make?

How much white sugar is needed for this many batches?

How much butter?

How much vanilla?

How much cocoa powder?

How much flour?

How much salt?

How much baking powder?

You should ask the user what they would like to name their cupcake- and output it

Ingredients

You can only buy flour in 5 lb bags - how many bags will you need to buy for this many batches?

You can only buy sugar in 7 lb bags - how many bags will you need to buy for this many batches

You can only buy butter in 8 cup blocks- how many blocks will you need to buy for this many batches

Assume all the other ingredients are in your kitchen at home

Hint there are 1.91 cups in a lb

The program must show the following in the output:

****** Remember - the blue if what the customer is inputting - everything else is calculated!

Looks for:

Calculations are completed properly, and output is similar to above

Decimals are not used when outputting number of bags of flour/ sugar, or blocks of butter being purchased

Heading is completed at the top of the program

Variables naming conversions are used

Appropriate data types are used

Constants used when necessary

comments are present throughout the code

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions