Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

NEED HELP WRITING THIS CODE WITH NO ERRORS PLEASE. Overview: For this stepping stone lab and others to come, you will create coding for a

NEED HELP WRITING THIS CODE WITH NO ERRORS PLEASE.

Overview: For this stepping stone lab and others to come, you will create coding for a program designed to manage recipes. In Stepping Stone Lab Two, you will begin working with a recipe manager program by focusing on a single ingredient. You will be introduced to basic data types

to store numeric values and string values.

You will build this ingredient in code that reflects variables such as its name, the number of cups of that ingredient needed in the recipe, and how many calories it has per cup. You will also write an expression to calculate the total number of calories this ingredient would contribute to a recipe.

To keep track of this information, you need to store it in a program. You will need to utilize variables of various data types to store the information and prompt the user for the various values. Once you get that information from the user, you can calculate the total number of calories per serving in your recipe.

Prompt: Use SteppingStone2_IngredientCalculator.java as your base code. Areas that require changes to the base code and/or additional code to be written are found in the commented areas that look like this:

/** * This is a commented area that describes the task to be completed in this stepping stone * */

Specifically, you will complete the following: A. Assign the variables with the appropriate data type and value as shown in the table below:

Variable Name

Type of Value Stored

nameOfIngredient

Text

numberOfCups

Decimal numbers (e.g., 12 a cup)

numberOfCaloriesPerCup

Whole numbers

totalCalories

Decimal numbers

B. Write an expression that multiplies the numberOfCups by the numberOfCalories per cup and assign this value to totalCalories.

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

More Books

Students also viewed these Databases questions

Question

Why did Kodak's Digital Strategy Fail?

Answered: 1 week ago