IT 511 SNHU Develop Code for Recipe Manager Program As you are learning, data types can move from the simple to complex as we construct programs designed t

IT 511 SNHU Develop Code for Recipe Manager Program As you are learning, data types can move from the simple to complex as we construct programs designed to solve problems. The second stepping stone lab presents an opportunity for you to create primitive data types then use them to construct the more complex forms of strings and arrays as you begin to develop code for a recipe manager program.

Starting with Stepping Stone Lab Two and continuing to the last stepping stone lab in Module Six, you will develop code for the program described in the Stepping Stone Overview document. You will start with a simple structure and gradually build in additional complexity and functionality. The overview also illustrates steps for completing and submitting these labs.

The stepping stone labs constitute a foundation upon which you will build the program you will submit for your final project. Most of the stepping stone labs outline the additional requirements for revising and expanding the concepts in the stepping stone labs as you work on the final project.

Go to the Start Here page and download the Stepping Stone code .zip for the starter code for this assignment.

To complete this assignment, review the following documents:

Stepping Stone Lab Two Guidelines
Stepping Stone Labs Two Through Six Rubric IT 511 Stepping Stone Labs Two Through Six Rubric
Overview: Beginning with Stepping Stone Two in Module Three, you will complete a series of related stepping stone labs that will help you build object-oriented
programming skills that relate to your final project. Be sure to incorporate feedback from your instructor as you develop your work through the stepping stone
labs and develop your final project.
Note that Stepping Stone Lab One: Pseudocode is graded with a separate rubric.
Stepping Stone Labs Two through Six specifics:
Stepping Stone
Module
Title/Topic
Task Specifics
Two
Three
Data Types
Produce basic data types for a recipe
manager program.
Three
Four
Validating Input With Branches
Develop a branched structure for a recipe
manager program.
Four
Five
Entering Ingredients With Loops
Develop iterative loops for a recipe manager
program.
Five
Six
Collection and Item Class With Accessors and
Mutators
Develop the first version of the Recipe class
and create a test class.
Six
Eight
The RecipeBox Driver Application
Produce a driver application for a recipe
manager program.
Each of your programming assignments includes two parts:


Code file(s)
Written reflection as text file or Word document
The assignment parts are submitted together with the written submission and with the code as a file attachment.
Critical Elements
The following critical elements should be addressed in your project submission:
I.
Code Reflection
A brief explanation of the code, its purpose, and a brief discussion of your experience in developing it, including any issues that you encountered
while completing the stepping stone and what approaches you took to solve them
II.
Specifications
Source code must meet its specifications as defined by the data and problem. However, this may require multiple attempts or iterations. You will be
given credit for code that is well on its way to meeting specifications or solving the problem.
III.
Correctness
Source code must behave as desired. While correct code produces the correct output as defined by the data and problem, for the stepping stones you
will receive credit for producing fully functioning code (producing no errors) that aligns with as many of the specifications as possible. Note: You should
write your code in such a way that the submitted files execute, even if they do not produce the correct output.
IV.
Readability
Code needs to be readable to a knowledgeable programmer. In this course, readable code requires the following:
 Consistent, appropriate white space (blank lines, spaces) and indentation to separate, distinct parts of the code and operations
 Explicit, consistent variable names that clearly indicate the data they hold and are formatted consistently
 Organized structure—clear design separating components with different responsibilities
V.
Annotation
All code should also be well-commented. This is a practiced “art” that requires striking a balance between commenting everything, which adds a great
deal of unneeded noise to the code, and commenting nothing. Well-annotated code requires you to do the following:
 Explain the purpose of lines or sections of your code, detailing the approach and method you took to achieve a specific task in the code.
 Document any section of code that is producing errors or incorrect results.
Rubric
Your assignment should be submitted as a zip file of the exported code and reflection text, as required.
Note that, although the stepping stone labs are graded, their main purpose is to provide useful practice and feedback that you can incorporate as you build the
knowledge and skills you need to succeed in the final project.
Critical Element
Code Reflection
Code
Requirements
Code Correctness
Code Readability
Annotation
Proficient (100%)
Describes purpose of the code, techniques
implemented to solve the problem, challenges
encountered, and the approaches to
overcome the challenges
All or most algorithm specifications are fully
met
The program functions as designed in most
cases
Code follows proper syntax and demonstrates
deliberate attention to spacing, white space,
and variable naming
Code annotations explain and facilitate
navigation of the code
Needs Improvement (70%)
Lacks details of code purpose, techniques
implemented, or challenges encountered
Not Evident (0%)
Does not describe purpose of code, techniques
used, or challenges encountered
Value
20
Details of the specifications are not met in
significant instances
The program functions as designed in limited
cases
Code contains variations from established
syntax and conventions
The program does not meet the specifications
20
The program does not function as designed
20
Code exhibits consistent and significant
variations from established syntax and
conventions
Code annotations do not explain the code, do
not facilitate navigation of the code, or are not
present
Total
20
Code annotations are incomplete or provide
insufficient assistance with understanding the
code
20
100%
IT 511 Stepping Stone Lab Two Guidelines
Recipe Manager Data Types
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., ½ 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.
Guidelines for Submission: This assignment should be submitted as a Java file.
Extending This Lab for Your Final Project
For your final project, do the following:
1. Create a new java class named Ingredient.
2. Adapt the code from this stepping stone to include the following changes:
A. Rename the variable numberCups to represent the more general ingredientAmount.
B. Add a new text variable, unitMeasurement, to store unit of measurement for the ingredient amount (cups, ounces, etc.).
C. Prompt the user to input the measurement unit.
SteppingStone2_IngredientCalculator.java
package SteppingStones;
import java.util.Scanner;
/**
*
* @author j.leone1
*/
public class SteppingStone2_IngredientCalculator {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
/**
*Assign the following variables with the appropriate data type and value:
*VARIABLE NAME
VALUE
*nameOfIngredient
“”
*numberCups
0
*numberCaloriesPerCup 0
*totalCalories
0.0
*/
Scanner scnr = new Scanner(System.in);
System.out.println(“Please enter the name of the ingredient: “);
nameOfIngredient = scnr.next();
System.out.println(“Please enter the number of cups of ”
+ nameOfIngredient + ” we’ll need: “);
numberCups = scnr.nextFloat();
System.out.println(“Please enter the name of calories per cup: “);
numberCaloriesPerCup = scnr.nextInt();
/**
* Write an expression that multiplies the number of cups
* by the Calories per cup.
* Assign this value to totalCalories
*/
System.out.println(nameOfIngredient + ” uses ” + numberCups
+ ” cups and has ” + totalCalories + ” calories.”);
}
}
IT 511 Stepping Stone Overview
Your work in this course includes a series of stepping stone labs that provide important practice in building key skills of object-oriented programming
that you will use in the final project. This table provides an overview of the stepping stone sequence, including a description of each lab and its location
in the course. A description of how to connect your work in each stepping stone to the final project is also provided.
The two final project milestones are also described here so that you can see how they also fit into your work for the course and help you prepare for the
final project.
The UML code for the course and stepping stone code completion and submission procedures are also included in this document.
Task
Module
Stepping Stone
Lab One:
Pseudocode
Two
Stepping Stone
Lab Two:
Data Types
Three
Stepping Stone Description
Final Project Connection
In Stepping Stone Lab One, you will write pseudocode for your
collection manager program.
The pseudocode is for a program
that is similar to the one in the final
project. In this case/scenario, the
student is helping a friend organize a
collection.
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.
For your final project, you will do the
following:
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.
We will assign variables of the appropriate data type and values as
shown below:
1. Create a new java class
named Ingredient
2. Adapt the code from this
Steppingstone to include:
A. Change numberCups to
represent a more
general measurement.
B. Add a variable to record
the type of
measurement (cups,
ounces, etc.).
C. Prompt the user to input
the type of
measurement.
Variable Name
Type of Value Stored
Name of ingredient
Words
Number of cups
Decimal numbers (e.g., ½ a cup)
Number of calories per cup
Whole numbers
Total calories
Decimal numbers
Once we get that information from the user, we can calculate the
total number of calories per serving in the recipe.
Stepping Stone
Lab Three:
Branches
Four
In this module, you have studied how to use conditionals and
logical structures to create branches or “forks in the code.” In
Stepping Stone Lab Three, you will put this emerging knowledge
into practice by developing a branching structure for the recipe
manager program.
Be sure to review the Stepping Stone Three guidelines before
beginning this lab. Remember, this document also includes
completed code from Stepping Stone Lab Two. This code serves
a number of functions:



It allows you to review your own submitted code.
You may use it as a useful foundation for Stepping Stone
Three as well as other assignments to come.
Together with instructor feedback on your submitted
code, you are building your own final project application.
In Stepping Stone Lab Three, you will write a short application that
uses conditionals to create a “forked” branching structure for the
recipe manager.
For your final project:
Adapt your Ingredient Java file to
include data-type validation steps for
each of the variables in the class:




ingredientName
ingredientAmount
unitMeasurement
ingredientCalories
Whenever a program accepts user input, it is best practice to be
sure the input is what you as the programmer expect. As you
continue to develop the recipe manager, you will need to be able
to validate user input and ensure the user enters values that are
valid. In this lab, you will write a short program that first tests that
the input is numerical, then checks that the number is within a
specific range, and checks that the maximum number of cups of
our main ingredient is 100 and that the minimum number of cups
is 1.
This application uses the Scanner class to accept a number
between 1 and 100 from the user. The Scanner class is useful for
parsing primitive values, including numbers.
Specifically, you will create a branching structure that leads to the
following output:
If the number entered is between 1 and 100 (inclusive), the
application will display a message that says, “Good job! The
number you entered is___.”
However, if the number entered is not between 1 and 100
(inclusive), an error message will be displayed to inform the
user that the entry does not fit the expected range: “The
number entered was not between 1 and 100!”
Stepping Stone
Lab Four:
Loops
Five
In Module Five, you have studied how to code for iteration through Milestone One:
the use of loops. In Stepping Stone Lab Four, you will develop a
Final Project Ingredient Class
simple program with a loop structure. Then, you will reflect on how
loops may be used to help structure the program you have been
working with throughout the stepping stones, designed to organize
and manage your friend’s collection.
Be sure to review the Stepping Stone Lab Four guidelines before
beginning this lab. As well as providing assignment information
and the grading rubric, this document includes corrected code
from Stepping Stone Lab Three, which may serve as a useful
foundation for Stepping Stone Lab Four as well as for other
assignments to come.
The code for this stepping stone lab is short, but the concepts are
extremely important. You will use two different looping
techniques: a “do” loop and a “for” loop.
This stepping stone lab also includes your first application of the
Java ArrayList data type. In this stepping stone lab, you will use the
ArrayList to store strings, but in future submissions, you will
replace these with object types (ingredients).
In this lab, you will write a short Java application that uses a loop
control structure.



When, or in the terms of object-oriented programming,
“while,” the input entered is not a specific value (“end”),
the program will loop back to prompt the user for another
input—either a valid value or an additional ingredient.
If the value entered is “n,” the application will display a list
of the ingredients entered.
Do not use a break statement in your program.
In your reflection, discuss how loops may be developed to add
utility to a program developed to manage your friend’s collection.
Describe the added functionality with specific examples.
Final Project
Milestone One:
Ingredient Class
Five
Your Ingredient class will model the details of individual ingredients
in a recipe. Based on Stepping Stone Labs Two and Three, you will
create an Ingredient class and give it the basic attributes: name,
amount, unit of measure, and calories. Additionally, you will add
code to validate the data type of the user input.
This Ingredient class will be modified for the submission of your
final RecipeManager application; however, it should be functional
code that accepts user input for each variable.
In your final project, you are creating
a program that will help you manage
a collection of items. To complete
this program, you will implement
two classes: one for the main item
and one for the entire collection. If
you decide to be more adventurous,
you can make an additional class for
the most important subcomponent
of your main item class.
Stepping Stone
Lab Five:
Recipe Class
With Accessors
and Mutators
Six
Now that you have some experience building basic, single-class
applications, here is an opportunity to delve into making a fullfledged application with more than one class. You will start to
implement a first version of the Recipe class and create a test class
to put it through its paces.
You will create the instance variables you need (the recipeName
and the mainIngredient details) as well as the methods (the
accessors/mutators, the constructors, and the extra print details
method) for the Recipe class. Then, you will create a driver, or test
class, that will create a Recipe object and try out a few of its
methods.
For your final project:


This stepping stone lab is the point where we start to pull all the
elements of the course together. You will build a Recipe class. In

the stepping stone lab assignment, you will get user input to collect
the recipe name and serving size, using the ingredient entry code
from SS4 to add ingredients to the recipe and calculating the
calories per serving. Additionally, you will build your first custom
method to print the recipe to the screen.
As you are developing the code in this stepping stone lab, you
should consider how you can transition it to your final project.
Eventually, the user input for collecting the ingredients into an
ArrayList of strings will be converted to an ArrayList of Ingredient
objects. Think about the variable names you are using and where in
the code you are collecting the ingredient input.
Change the ArrayList type from
String to an Ingredient object.
When a user adds an ingredient
to the recipe, instead of adding
just the ingredient name, you
will add the actual ingredient
including name, amount, and
calories.
Adapt the printRecipe() method
to print the amount and unit of
measurement as well as the
ingredient name.
Create a custom method in the
Recipe class. Choose one of the
following options:
A. Print out a recipe with
amounts adjusted for a
different number of servings.
B. Create an additional list or
ArrayList that allows users to
insert step-by-step recipe
instructions.
C. Convert the ingredient
amounts from English to
metric (or vice versa).
D. Calculate select nutritional
information.
E. Calculate recipe cost.
F. Propose a suitable
alternative to your
instructor.
Final Project
Milestone Two:
Recipe Class
Seven
In your final project, you are creating a program that will help you
manage a collection of recipes. The Recipe class you will build for
this milestone will hold all the details of the recipe, the methods to
create a new recipe, and a method to print a recipe. In your final
project submission, this class will also contain a custom method to
add a new feature. In your submission for Milestone Two, you will
include commented out pseudocode for this method.
In this milestone, you submit the final project version of your
Recipe class. Your submission should include the Recipe.java file
and a Recipe_Test.java file.
Your Recipe class should include the following items:






Instance variables : recipeName, servings,
recipeIngredients, and totalRecipeCalories
Accessors and mutators for the instance variables
Constructors
A printRecipe() method
An createNewRecipe() method to build a recipe from user
input
Pseudocode for the custom method selected from the list
in Stepping Stone Lab Five
Your Recipe_Test.java file with a main() method that does the
following:



Stepping Stone
Lab Six:
RecipeBox
Eight
Uses a constructor to create a new recipe
Accesses the printRecipe() method to print the formatted
recipe
Invokes the createNewRecipe()method to accept user
input
In this stepping stone lab, you will create the RecipeBox driver
application. This class will be the class that contains the only
“public static void main(String[] args)…
Purchase answer to see full
attachment

Submit a Comment